Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
PescheSwitzerland
Contributor II
Contributor II

FirstSortedValue - should I use it?

Dear Folks 🙂

I have the field "Stock_Amount". And for every day I have this value in a table, but it comes with a key: 6_26.06.2024. What I want is, that I see for every product the current Stock_Amount.

What would you suggest?

Thanks a lot!

Labels (3)
1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

Sounds as if you should.

Try
FirstSortedValue(Stock_Amount,-Date)
with "Product" as dimension. Note the minus sign.

If you don't have the "Date" field, I suggest you create it in the script using
Date#(SubField(Key,'_',2),'DD.MM.YYYY') as Date

View solution in original post

1 Reply
hic
Former Employee
Former Employee

Sounds as if you should.

Try
FirstSortedValue(Stock_Amount,-Date)
with "Product" as dimension. Note the minus sign.

If you don't have the "Date" field, I suggest you create it in the script using
Date#(SubField(Key,'_',2),'DD.MM.YYYY') as Date