

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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ö
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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))


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The exact same formula works elsewhere in the same application???

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here you go... awesome.. I am glad it worked out for you now
