
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to get Totals while using aggr in Qliksense
Hi ,
I am grouping my expression according to a column using 'aggr' in the expression editor. I am not able to get any value in Totals column.
For example,
I want to display aggr(sum(aggr(sum(revenue),city)),country), how can I get the corresponding expression to flash in the Totals row?
Country | City | Revenue($ mn) |
India | Delhi | 12 |
India | Gurgaon | 4 |
India | Noida | 11 |
India | Pune | 17 |
India | Hyderabad | 5 |
India | Banglore | 7 |
USA | New York | 13 |
USA | LA | 3 |
USA | Detroit | 2 |
USA | Washington | 15 |
I want my final aggregation with respect to countries
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why not just use Sum(revenue)? or may be this
Sum(Aggr(Sum(revenue), country, city))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why not just use Sum(revenue)? or may be this
Sum(Aggr(Sum(revenue), country, city))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can have naked aggr expression to show total so as Sunny mentioned, always have an outer aggregation such as sum.
HIC has written an excellent article on how AGGR works.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i think
sum(aggr(sum(aggr(sum(revenue),city,country)),country))


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Might also verify that Revenue is actually of type number number and not coming in your load as a text.
IsNum(Revenue) should return -1. If it returns Zero you are dealing with text and your math function won't work.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No need to aggr sum of sums.
if the revenue is in the data model at the city, country level or lower (like a time dimenison), a straight sum with city and country as dimensions would sum by those keys.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
unless if you want something else than the sum
only Sum(Revenue) is the same

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sunny,
Please
vitória - ES
