Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Team,
i want to get max value from a table assign that value to a variable and then use same variable to a load statement. please help what i am doing wrong i am getting null value in the variable.
temp:
LOAD max(WEEKNO) as maxWeekNo Resident tbl_WeeklyData;
let v14WeekNo = Previous(maxWeekNo);
tbl_14WeekInfo:
LOAD SC_CODE,
SC_CODE_M,
SC_NAME,
SC_GROUP,
SC_TYPE,
AVG_NO_OF_SHRS,
// if(AVG_NO_OF_SHRS > 10000, '>10000', '<=10000') as Flag,
WEEKYEAR_KEY Resident tbl_WeeklyData
Where WEEKNO = $(v14WeekNo);
DROP Table temp;
Hi Jitendra,
try not putting your variable v14WeekNo into brackets - it is a simple number, isn't it? That doesn't need dollar-sign-expansion. Play around a bit with that, it can be - different from what you'd expect 😉
Have you tried setting a Breakpoint ("EXIT SCRIPT") to make sure your variable exists and has the value you want?
Hi,
Try below,
let v14WeekNo = Peek('maxWeekNo', 0, 'temp')
Thanks Satyadev, Actually i was using peek only but forget to provide the single quote "'" in the peek function//