Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Firstsortedvalue with condition

Hi,

I have the following three fields,

[Item Number]

[Item Update Price]

[Item Update Timestamp]

[Item Update Awarded?]

I want to show the latest price ([Item Update Price]) per Item Number given that the price has been awarded ([Item Update Awarded?]='Yes')? I have written the following statement and it shows the latest price.

=firstsortedvalue([Item Update Price],-[Item Update Timestamp])

But I only want to display [Item Update Price] that have the condition [Item Update Awarded?]='Yes'

How do I write this?

Thankful for any help!

Br,

Jonas

1 Solution

Accepted Solutions
erichshiino
Partner - Master
Partner - Master

Try to use the set analysis to force that value as a condition:

=firstsortedvalue( {<[Item Update Awarded?]={Yes}>}  [Item Update Price],-[Item Update Timestamp])

If it doesn't work, can you share some data so we can reproduce your problem ?

Hope it helps,

Erich

View solution in original post

2 Replies
erichshiino
Partner - Master
Partner - Master

Try to use the set analysis to force that value as a condition:

=firstsortedvalue( {<[Item Update Awarded?]={Yes}>}  [Item Update Price],-[Item Update Timestamp])

If it doesn't work, can you share some data so we can reproduce your problem ?

Hope it helps,

Erich

Not applicable
Author

Perfect Erich! Thanks!

Didn't know FirstSortedValue was considered an aggregation function.

Best Regards,

Jonas