Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts
I have a loading script to get current years YTD: if(InYearToDate(%Key_Date,Today(),0) * (-1)>0,1) as YTDFlag
But we need to be more flexible / dynamic, depending on the selected year the YTD must change. This logic gives an error while loading: if(InYearToDate(%Key_Date, max(year(%Key_Date)),0) * (-1)>0,1) as YTDFlag
Any ideas?
Thank you, Tom
You can't have a script expression reference a user selection, so even if the syntax was correct, this wouldn't work. You'll have to write this expression on the front end, not in the script, if you want it to reference a selection.
Typically this would be handled by using InYearToDate(Field) to create a flag of whether a date is within the YTD range (for any year) and then applying that flag in set analysis on the front end. You would handle the year aspect separately within the same set analysis.