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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
GOKULAKANNAN
Creator II
Creator II

Display maximum and minimum value

I have 3 fields, country,states and population , I need to display the maximum and minimum populated country in KPI, How can I do that. 

 

Labels (1)
1 Solution

Accepted Solutions
edwin
Master II
Master II

if multiple countries have the same total population, you want to display just 1 of the totals and not TOTALS of all these countries:

this is the max:
=only(aggr(sum({<Country={"=rank(sum(population))=1"}>}population), Country))

aggregate it by ciuntry and get just one value

and maybe you want to show all countries with the max population:
=concat(distinct {<Country={"=rank(sum(population))=1"}>}Country,',')

 

View solution in original post

3 Replies
edwin
Master II
Master II

this is the population of country with highest poplation:
=sum({<country={"=rank(sum(population))=1"}>}population)

this is the country with highest population:
=only({<Country={"=rank(sum(population))=1"}>}Country)

Lowest:
=sum({<country={"=rank(sum(-population))=1"}>}population)

=only({<Country={"=rank(sum(-population))=1"}>}Country)

 

 

edwin
Master II
Master II

you need to consider also if there is a possibility that two countries or two regions/states will have exactly the same population.

edwin
Master II
Master II

if multiple countries have the same total population, you want to display just 1 of the totals and not TOTALS of all these countries:

this is the max:
=only(aggr(sum({<Country={"=rank(sum(population))=1"}>}population), Country))

aggregate it by ciuntry and get just one value

and maybe you want to show all countries with the max population:
=concat(distinct {<Country={"=rank(sum(population))=1"}>}Country,',')