Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Tobschmi
Contributor II
Contributor II

Value over the last two dates of a Filter list

Hello, everyone,

I have set different filters in a table, the data looks like this:

IdPurchase datePurchase priceDifference price
100011.10.20190,71-0,09
100002.09.20190,80-
100009.07.20190,75-
200011.10.20191,250,12
200002.09.20191,13-
200009.07.20191,20-

 

What I want to do: I always want to calculate the difference between the last two purchase dates. I want to display this in the column Difference price.

I have already tried =Date(Max(Date)-1), but unfortunately I can't get any further. Can anyone give me a hint?

Greetings Tobias

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

FirstSortedValue(Total <Id> [Purchase price], -[Purchase date])
-
FirstSortedValue(Total <Id> [Purchase price], -[Purchase date], 2)

View solution in original post

2 Replies
tresesco
MVP
MVP

Try like:

FirstSortedValue(Total <Id> [Purchase price], -[Purchase date])
-
FirstSortedValue(Total <Id> [Purchase price], -[Purchase date], 2)
Tobschmi
Contributor II
Contributor II
Author

Thanks a lot, works perfectly!