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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Compare value of different date

Hi,

in the attached document I have prepared a little example.

I want to show the difference between the Sales calculated against the selected date and the Sales calculated against the selected date - 1.

Can you explain me how can I do this ?

Thx 🙂

2 Replies
Not applicable
Author

Use set analysis and create 2 variables

vToday =Date
vPreviousDate =date(vToday -1)


first expression =sum(Sales)
second expression =sum({<Date= {'$(vPreviousDate)'}>} Sales)
third expression = column(1)-column(2)

see attached

Not applicable
Author

The variables work well. You can also do it with straight Set Analysis using something like:

Sum({<Date={'$(=Date(Max(Date)-1))'}>}Sales)