Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
inyeartodate(TempDate, $(vToday),0) * -1 As
CurYTDFlag,
inyeartodate(TempDate, $(vToday), -1) * -1 As
LastYTDFlag
Hello!
First function checks TempDate in the same year as vToday and sets true in this way
The second one does the same only for previous year
Hi
inyeartodate() function is the function that creates the flags in your master calendar.
Flags are fields that can have the values 1 or 0.
The first row checks the TempDate field and compares it with the $(vToday) variable.
If TempDate value belongs to the same year as the vToday (this is because of the 0 we are using as the third parameter in the inyeartodate function) but earlier this year, then the inyeartodate() function will return True.
But for QlikView, True is -1. So we have to multiply if by -1 (*-1) to give the value 1 to our flag.
The second row again checks the TempDate field and compares it with the $(vToday) variable.
If TempDate value belongs to the previous year than the vToday (this is because of the -1 we are using as the third parameter in the inyeartodate function) but earlier that year, then the inyeartodate() function will return True.
I hope this helps
Regards
Agis
Hi again
Can you please tag the answer as Helpful or Correct if this was what you're looking for so as to close the discussion?
Thanks
Agis