Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a date variable (Date_In) formatted YYYY-MM-DD.
I need some logic please to calculate YTD as currently I hard code it in like below:
DATE_IN = {"2018*"}
It would be useful to have another calculation for previous year too please as I do the same as above:
DATE_IN = {"2017*"}
Thanks
Hi ,
you could try:
DATE_IN{">=2018-01-01 <=2018-12-31"} for example.
Same for 2017.
And you can make the date fields dynamic if you want. Like:
DATE_IN(">=$(=MIN(DATE_IN)) <=$(=MAX(DATE_IN))"}
Hi,
Try YEARTODATE function in
You should make a flag in your calendar script:
InYearToDate(<DateField>, Today(), 0) * -1 AS CYTDFlag InYearToDate(<DateField>, Today(), -1) * -1 AS LYTDFlag
Then use the flag in your set analysis:
SUM({$< CYTDFlag = {1}>} <Field> )