Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
WellingtonRM
Contributor
Contributor

Date range with set analysis

Good afternoon, I'm creating two master items, one to fetch the sum of values ​​from the previous day and the other to fetch the sum of the current day.
I'm trying to do set analysis but it's not working. Basically my expressions are:

Previous Date:
sum({<date = {"< $(=DATE(MAX(date)))"}>}value)
Current date:
sum({<date = {"<=$(=DATE(MAX(date)))"}>}value)

Can anyone help me?

 

1 Solution

Accepted Solutions
rubenmarin

Hi, that expression will return an acumulate from the first date loaded until yesterday, is that what you want or only yesterday sales without accumulation from the begining?

You can try with: sum({<date = {"$(=DATE(MAX(date)-1))"}>}value) and sum({<date = {"$(=DATE(MAX(date)))"}>}value)

The issue can be also becuase of date formats, which date format has the 'date' field? Try to add the same format to the Date function: sum({<date = {"$(=DATE(MAX(date)-1,'DD/MM/YYYY'))"}>}value)

View solution in original post

2 Replies
rubenmarin

Hi, that expression will return an acumulate from the first date loaded until yesterday, is that what you want or only yesterday sales without accumulation from the begining?

You can try with: sum({<date = {"$(=DATE(MAX(date)-1))"}>}value) and sum({<date = {"$(=DATE(MAX(date)))"}>}value)

The issue can be also becuase of date formats, which date format has the 'date' field? Try to add the same format to the Date function: sum({<date = {"$(=DATE(MAX(date)-1,'DD/MM/YYYY'))"}>}value)

WellingtonRM
Contributor
Contributor
Author

Hi, this will return the accumulated from the first date loaded until yesterday.
The way he gave it to me was exactly how I did it and it didn't work,
but I managed to solve it, the problem was the date format.

thanks