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: 
greend21
Creator III
Creator III

Max in IF statement in load

I am trying to put the below calculation into my load so I can then use this flag in set analysis. Can this not be done? I keep receiving errors. I didn't think I would need a group by since Max is within the IF.

If(ReportDate>=Max(ReportDate)-5,1,0) as CADateFlag

12 Replies
greend21
Creator III
Creator III
Author

In SQL it has to be formated like SQL SELECT CAST(Max(ReportDate)-5 as Date) but whether I do this or not I get the result in a date format.

greend21
Creator III
Creator III
Author

I am getting a date just like in the database.

olivierrobin
Specialist III
Specialist III

date and time

can't this be the problem ?