Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis - Greater than the Current Date

I would like to sum all records where the Record Type = 'Actual' and Date (this is the name of the column) is greater than the Current Date.

The set analysis I used always display a value of zero. I understand that the Date and Today() dates should be of the same format to get the desired result but I'm still unable to get the correct result even with formatting included.

Below is my code.

sum({$<[Record Type]={'Actual'}, Date = {"> $(=Date(Today(),'MM-DD-YYYY'))"}>} Dollars)



1 Solution

Accepted Solutions
Not applicable
Author

So the problem was the date format. I converted the Date to num(Date) as "Fiscal Date" in my Load Script and use that in my Set Analysis. So instead of formatting, I just used the number equivalent of the date and that did the trick. Really hate dealing with Date comparison in QV.

=sum({$<[Record Type]={'Actual'}, [Fiscal Date]= {"> $(=num(Today()))"}>} Dollars)

View solution in original post

3 Replies
johnw
Champion III
Champion III

Looks right to me. The only thing I'm thinking is maybe it doesn't like the space after the greater than sign. I don't put a space there myself, but I don't know if that's just habit or a requirement.

Not applicable
Author

Hi John. Thanks for the reply.

I removed the space and the issue still exists. I think the problem is still in the date formatting. I'll try to figure out what sort of format it's expecting and probably use some variables while I'm at it.

Not applicable
Author

So the problem was the date format. I converted the Date to num(Date) as "Fiscal Date" in my Load Script and use that in my Set Analysis. So instead of formatting, I just used the number equivalent of the date and that did the trick. Really hate dealing with Date comparison in QV.

=sum({$<[Record Type]={'Actual'}, [Fiscal Date]= {"> $(=num(Today()))"}>} Dollars)