Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

can anyoneexplain me the following

inyeartodate(TempDate, $(vToday),0) * -1 As

CurYTDFlag,

inyeartodate(TempDate, $(vToday), -1) * -1 As

LastYTDFlag

3 Replies
pokassov
Specialist
Specialist

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

Agis-Kalogiannis
Employee
Employee

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

Agis-Kalogiannis
Employee
Employee

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