Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Aggr SumTotal

I am trying to do a total sum of an aggregation without success.

I have 3 variables:

  • Country
  • Region
  • Population

I would like to have always in one column the sum of population of all Countries and Regions at continent level, regardless of being selected.

Therefore, in case of not selecting anything, the figure should be 1,934 (note that the sum of population is not a simple sum but a aggregated sum of region and country) and in case of selecting a region or country, the sum should continue being 1,934.

Captura.JPG

The calculus being used:

sum( total <Continent>    {<Country>}

aggr(   Population,Country, Region ))

However, if I select 1 country, I see the data of the country (0,24), not the total (1,934) that I want.

Captura1.JPG

Please find attached thhe document where I am trying to obtain this calculus.

Thank you so much.

1 Solution

Accepted Solutions
sunny_talwar

Try this:

=Sum(TOTAL <Continent> {<Country>} Aggr(Only({<Country>}Population), Country, Region))

View solution in original post

3 Replies
sunny_talwar

Try this:

=Sum(TOTAL <Continent> {<Country>} Aggr(Only({<Country>}Population), Country, Region))

Not applicable
Author

Wonderful! this is working perfectly!!

thank you!

sunny_talwar

Awesome