Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

yesterday using today() in set analysis

Hello,

I am attempting to use today() to get the value of yesterday in set analysis. I am getting a value for the expression below however, I do not believe it is correct. Basically I am attempting to sum sales where EndDate is greater than or equal to yesterday.

=sum({$<EndDate={">=$(=today(),-1)"}>} Sales)

Any help, or validation would be greatly appreciated.

Thanks much,

Jeff

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

Looks like a syntax error to me - it shouldn't allow the comma after today(). Assuming that's just a typo when posting, it looks right to me. However, you may need to format the result as a date of the same format as EndDate. So, for instance, if EndDate has a format of 'DD/MM/YY', you may need to use sum({<EndDate={">=$(=date(today()-1,'DD/MM/YY'))"}>} Sales). Set analysis isn't very good with date comparisons, and needs the formats to match in order to recognize they're the same, unlike an if() statement, for instance.

View solution in original post

1 Reply
johnw
Champion III
Champion III

Looks like a syntax error to me - it shouldn't allow the comma after today(). Assuming that's just a typo when posting, it looks right to me. However, you may need to format the result as a date of the same format as EndDate. So, for instance, if EndDate has a format of 'DD/MM/YY', you may need to use sum({<EndDate={">=$(=date(today()-1,'DD/MM/YY'))"}>} Sales). Set analysis isn't very good with date comparisons, and needs the formats to match in order to recognize they're the same, unlike an if() statement, for instance.