Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I couldn't run this script as it shows as
vMonthLoop = to
in the debugger
I don't understand what's wrong with this,
Can anyone help to fix my script?
Thank You!
let vStartYear = Min(AccidentYear);
let vEndYear = Max(AccidentYear);
//*************************Finding the Max Development Month for each Year*********************************
FOR vMonthLoop = $(vStartYear) to $(vEndYear)
Left Join(CTRNPF)
LOAD
max(DevelopmentMonth) AS MaxMonth$(vMonthLoop)
Resident CTRNPF_Max where AccidentYear=$(vMonthLoop);
NEXT
You can't aggregate field values just like you've done in your vStartYear and vEndYear definitions.
You need to do the aggregations in a LOAD statement, then peek() the values from the table:
EXT:
LOAD Min(AccidentYear) as Min,
Max(AccidentYear) asMax
Resident YourTablewithAccidentYear;
let vStartYear = Peek('Min',0,'EXT');
let vEndYear = Peek('Max',0,'EXT');
DROP TABLE EXT;
Check the variables in script debugger at this point. Both should hold numeric values.
You can't aggregate field values just like you've done in your vStartYear and vEndYear definitions.
You need to do the aggregations in a LOAD statement, then peek() the values from the table:
EXT:
LOAD Min(AccidentYear) as Min,
Max(AccidentYear) asMax
Resident YourTablewithAccidentYear;
let vStartYear = Peek('Min',0,'EXT');
let vEndYear = Peek('Max',0,'EXT');
DROP TABLE EXT;
Check the variables in script debugger at this point. Both should hold numeric values.
Thank You. It works!!!!