Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I have declared a variable which does a data conversion. I want to add this variable so that it loads the correct file which has this date appendage at the end, while in a loop.
set
PrevDateYYMM= right(date(addMonths(MAKEDATE(20&LEFT([Master_Calendar_Month_Key],2),RIGHT([Master_Calendar_Month_Key],2)), -1)), 2) & mid(date(addMonths(MAKEDATE(20&LEFT([Master_Calendar_Month_Key],2),RIGHT([Master_Calendar_Month_Key],2)), -1)), 4, 2);
LOAD
'$(PrevDateYYMM)'
TEAM
FROM [REPORT_$(PrevDateYYMM)];
The problem is with this is that it does not evaluate the variable. If I create a field in the script with the same code I get the correct figures but I have to compute this in the script to load the correct files as I am also doing a loop. What it is not doing is giving an error saying cannot load REPORT_$right(date(addMonths(MAKEDATE(20&LEFT([Master_Calendar_Month.......(full expression).
I've tried using both let and set but neither are giving me the answer i want. Has anyone any ideas as the method to create the value is correct, it just uses the expression and not the computed value in the script.
Thanks,
Put the word LET in front of the variable declaration instead of SET 🙂
Regards,
Thanks Vlad,
Had used LET previously - just realised the problem I had was i was referencing the wrong field when doing so, d'oh! 🙂
Thanks again