Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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,',')
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)
you need to consider also if there is a possibility that two countries or two regions/states will have exactly the same population.
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,',')