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: 
jw22
Contributor II
Contributor II

Calculate difference of amounts of two dates

Hello Qlik Community,

I have an table with following data:

jw22_0-1711092851639.png

And as filter panel I have "Date".

I now want a Measure where the difference between two Amounts of two Dates is calculated.

When 19.03.2024 and 20.03.2024 in the filter pane is selected, I want the measure to show -500. (1000-1500). Always the Amount of the older selected Date minus the newer selected Date.

Thank you!

Labels (1)
2 Solutions

Accepted Solutions
LRuCelver
Partner - Creator III
Partner - Creator III

Try this:

Sum({<Date={"$(=Min(Date))"}>} Amount) - Sum({<Date={"$(Max(Date))"}>} Amount)

If it doesn't work, try adding the date formatting:

Sum({<Date={"$(=Date(Min(Date), 'DD.MM.YYYY'))"}>} Amount) - Sum({<Date={"$(=Date(Max(Date), 'DD.MM.YYYY'))"}>} Amount)

View solution in original post

Clement15
Creator III
Creator III

Hello, you can use alternate state for this.

Alternate States | QlikView Help

Clement15_0-1711095648001.png

 

View solution in original post

3 Replies
LRuCelver
Partner - Creator III
Partner - Creator III

Try this:

Sum({<Date={"$(=Min(Date))"}>} Amount) - Sum({<Date={"$(Max(Date))"}>} Amount)

If it doesn't work, try adding the date formatting:

Sum({<Date={"$(=Date(Min(Date), 'DD.MM.YYYY'))"}>} Amount) - Sum({<Date={"$(=Date(Max(Date), 'DD.MM.YYYY'))"}>} Amount)
Clement15
Creator III
Creator III

Hello, you can use alternate state for this.

Alternate States | QlikView Help

Clement15_0-1711095648001.png

 

jw22
Contributor II
Contributor II
Author

Thank you very much, all solutions are working fine!