Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

I'm trying to compare dates in my database to see whether the record is from a recent report; can anyone help me detect dates which are recent.

I'm trying to compare dates in my database to see whether the record is from a recent report; can anyone help me detect dates which are recent. I've tryed creating an the following expression

 

=IF(alt(Date#(ClosePeriod,'DD-MM-YYYY'))>=Date(Today()-7),'Recent Report')

But I just get NULLs

1 Solution

Accepted Solutions
Not applicable
Author


Thanks Adding the ELSE element (see below) makes this work.

 

=IF(alt(Date#(ClosePeriod,'YYYY-MM-DD'))>=Date(Today()-7),'Recent Report','Old')

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Your alt function is missing an else parameter. You didn't specify an alternative value. Try =IF(alt(Date#(ClosePeriod,'DD-MM-YYYY'),0)>=Date(Today()-7),'Recent Report')


talk is cheap, supply exceeds demand
Not applicable
Author


Thanks Adding the ELSE element (see below) makes this work.

 

=IF(alt(Date#(ClosePeriod,'YYYY-MM-DD'))>=Date(Today()-7),'Recent Report','Old')