I've created a TI process to get the data from Teradata. In my Data source tab, i defined the query to pull only Top 10 rows from the table and I'm overwriting my query in prolog tab using a where clause.
When I run the process i would like to automatically pass the season based on Current month.
Code: Select all
Code in Prolog is like:
vCurrentSeason = TRIM(Timst (Now , ' \Y\m' ) ) ;
IF (SUBST (vCurrentSeason, 5,2) @= '01' );
vNewCurrentSeason = 'SP' | SUBST (vCurrentSeason, 1,4) ;
ELSEIF (SUBST (vCurrentSeason, 5,2) @= '02' );
vNewCurrentSeason = 'SP' | SUBST (vCurrentSeason, 1,4) ;
and so on...
ENDIF;
vPrevseason= ATTRS ('Season' , vNewCurrentSeason , 'PrevSeason');
DatasourceQuery = Expand ( '
SELECT Geo, Div, Category_Cd, Bus_Sesn_Yr_Cd_SSYYYY, Units, Value FROM DDC.Actuals where Bus_Sesn_Yr_Cd_SSYYYY = %vPrevSeason% ; ');
Code: Select all
Error: Data procedure line (0): Error executing SQL query: " SELECT Geo, Div, Category_Cd, Bus_Sesn_Yr_Cd_SSYYYY, Units, Value FROM DDC.Actuals where Bus_Sesn_Yr_Cd_SSYYYY = SP2016; "
Could anyone let me know, how to deal with this situation?
Thanks,