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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Pick the dimension with a greatest value

hi,

  for example i have the following table

  Age group       Population

   21-24                 30

   25-29                 45

   30-36                 22

    37-above          10

based from the table above, I need to make a text where i need to state that 25-29 is the age group with the biggest population.

I need to make a text box where it includes an expression that can compute for the age group diimension that has the biggest population.

 

Many thanks for the help.

1 Solution

Accepted Solutions
sunny_talwar

May be just this

Max(Aggr(Count(Population), [Age Group]))

or if your expression is just Population, then this

Max(Population)

View solution in original post

7 Replies
passionate
Specialist
Specialist

Hi Ronald,

Create a Variable to have Max of Population.

Let vMax= max(Population);

Use below Set Analysis in test box:

=Only({<Population={"$(vMax)"}>}Agegroup)

Please let me know if this is what you expect.

Cheers,

Pankaj

sergio0592
Specialist III
Specialist III

Try with

FirstSortedValue(Age group, -Population)

ecolomer
Master II
Master II

Is this you need?

P_256508.png

sunny_talwar

May be this if your chart expression is Count(Population) in the chart we are seeing above...

FirstSortedValue([Age group], -Aggr(Count(Population), [Age Group]))

Anonymous
Not applicable
Author

hi, the firstsortedvalue worked,, thanks a lot.. now i can get the category with the highest value.

how about if i want to display the value instead?

instead of displaying 25-29 age group, i want to display the population which is 45.

Thanks again

sunny_talwar

May be just this

Max(Aggr(Count(Population), [Age Group]))

or if your expression is just Population, then this

Max(Population)

Anonymous
Not applicable
Author

thanks a lot Sunny its all working now

thanks to all who replied as well