Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

kavicsgym
Contributor

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
Contributor

Re: FirstSortedValue not work in KPI box (Qlik Sense)

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 :-)

5 Replies
MVP
MVP

Re: FirstSortedValue not work in KPI box (Qlik Sense)

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
Contributor

Re: FirstSortedValue not work in KPI box (Qlik Sense)

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
Contributor

Re: FirstSortedValue not work in KPI box (Qlik Sense)

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 :-)

MVP
MVP

Re: FirstSortedValue not work in KPI box (Qlik Sense)

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

MVP
MVP

Re: FirstSortedValue not work in KPI box (Qlik Sense)

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