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: 
TomBond77
Specialist
Specialist

Find last record to a key field

Hi experts

I need to find the second last record of this simple table. The condition is: if Version = 'Working Version' then last record of %Key1. I have solved this with extra column.

How do I get the 2nd last record for cases that %Key1 has a version "Working Version'? How can I flag the second last record in this scenario? I need the last Version = 'Latest'. 

TomBond77_1-1718096064290.png

 

 

5 Replies
Rohan
Specialist
Specialist

Hi @TomBond77 ,

Have a look at my script, I think this will do the trick : 

Rohan_0-1718184244623.png

Let me know if it works for you.

Regards,

Rohan.

TomBond77
Specialist
Specialist
Author

Thanks @Rohan 

Why do you need a %Key2 field in the map area?

Many thanks, Tom

Rohan
Specialist
Specialist

Key2 is a reference field based on which the mapping is being done.

 

Regards,

Rohan.

TomBond77
Specialist
Specialist
Author

Thanks @Rohan

Will this also work if there are more than one %Key1 record for  DOC_REV value of  "3" exist?

TomBond77_1-1718187561203.png

 

 

Rohan
Specialist
Specialist

Yes.