Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
March 11, 2PM EST: Do More with Qlik - Getting Started wtih Qlik Sense SaaS - Redux. REGISTER 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)

View solution in original post

Tobschmi
Contributor II
Contributor II

Thanks a lot, works perfectly!