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: 
harsha087
Contributor III
Contributor III

second last car purchase date

Hi All,

Below is the data ,

Purchase_DateCar_BrandPriceYearMonthType
09/12/2020Volvo3822677202012SEDAN
02/11/2020Volvo1599298202011SEDAN
15/11/2020Volvo1954432202011SEDAN
16/11/2020Mercedes9478128202011ELECTRIC
16/11/2020Mercedes6471128202011SEDAN
19/11/2020Mercedes6049416202011SEDAN
22/11/2020Mercedes8705679202011SEDAN
19/10/2020Jaguar4713860202010ELECTRIC
20/10/2020Jaguar9486007202010ELECTRIC
21/10/2020Jaguar4350439202010ELECTRIC
28/10/2020Jaguar3185625202010ELECTRIC

 

i need to show second last car purchase date  where brand is 'Mercedes’ and car type is 'SEDAN' without using hardcoded date or year-month in set analysis in KPI OR Text box. 

however, i have created rank and written below expression, but i m not getting values 

max({1<Car_Brand={"Mercedes"},Type={"SEDAN"},rank={"2"}>}Purchase_Date)

let me know if i m wrong .. 

Labels (3)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

I don't get the same output from you  Excel file.

Vegar_0-1629444573540.png

See attached "Car Sales.qvf"

View solution in original post

5 Replies
Vegar
MVP
MVP

You can fetch the date by using max([Purchase date], 2) to get the second largest value. See image below.

Vegar_0-1629405105077.png

 

harsha087
Contributor III
Contributor III
Author

Thanks for ur quick response ..

When i write the same logic on my data .. below is what i can see .. Could you help when i did a mistake .. 

harsha087_0-1629433392148.png

 

I don't see values for Mercedes .. Attached is the whole data i have it .. 

 

Vegar
MVP
MVP

I don't get the same output from you  Excel file.

Vegar_0-1629444573540.png

See attached "Car Sales.qvf"

harsha087
Contributor III
Contributor III
Author

Thank You ...  🙂

Vegar
MVP
MVP

Glad I could be of help!