Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
kavicsgym
Creator
Creator

FirstSortedValue not work in KPI box (Qlik Sense)

Hi, a FirstSortedValue expression does not work for me in KPI box but does work in Text Box:

FirstSortedValue(agegroup, -Aggr(sum({$<ON_OFF= {'ON'}>} counter), agegroup) )

It is an acceptable workaround, however, all other KPI-s are in KPI box and I cannot format the 2 boxes exactly the same. (text and KPI)

Any ideas? thanks a lot!

Enikö

1 Solution

Accepted Solutions
kavicsgym
Creator
Creator
Author

omg, I realized what went wrong: Number formatting under the measure should NOTbe Auto BUT Number and than it returns the correct string in KPI 🙂

View solution in original post

5 Replies
sunny_talwar
MVP
MVP

May be there are two values at the max counter and that why it isn't able to return any value.

Try this may be:

FirstSortedValue(DISTINCT agegroup, -Aggr(sum({$<ON_OFF= {'ON'}>} counter), agegroup))

kavicsgym
Creator
Creator
Author

Hi, thanks, I am aware Firstsortedvalue returns null if there are more than one first sorted value.

But I use the same expression in the same QlikSense app in 2 different boxes - one returns a value (checked and ok) one doesn't.

kavicsgym
Creator
Creator
Author

omg, I realized what went wrong: Number formatting under the measure should NOTbe Auto BUT Number and than it returns the correct string in KPI 🙂

sunny_talwar
MVP
MVP

The exact same formula works elsewhere in the same application???

sunny_talwar
MVP
MVP

Here you go... awesome.. I am glad it worked out for you now