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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

totals in rows of a pivot table

Hello
got a pivot table with an expression that is giving the below result:

ali_hijazi_0-1700227018492.png

what I want in the second column is to have under AMER 365 and under APAC  473 which are the totals

of my expression in the first column and thus I can calculate the % and cumulative %
4 / 365
2/365

...
and under APAC
2/473
3/473

...
my expression is a simple count

I can walk on water when it freezes
Labels (1)
1 Solution

Accepted Solutions
marcus_sommer

You need to specify all dimensions within the total <Dim1, Dim2, ...> which should be consider (seems to be the horizontal ones) within the aggregation. Further for a simple count you don't need an aggr() and could skip this part.

View solution in original post

4 Replies
marcus_sommer

You need to specify all dimensions within the total <Dim1, Dim2, ...> which should be consider (seems to be the horizontal ones) within the aggregation. Further for a simple count you don't need an aggr() and could skip this part.

ali_hijazi
Partner - Master II
Partner - Master II
Author

Hello Marcus
didn't work
it is displaying the whole total (as if putting total without  including any dimension in <> )
but works if I select AMER or APAC one at a time

I can walk on water when it freezes
ali_hijazi
Partner - Master II
Partner - Master II
Author

what I want is to aggr to the dimension just before the one not expanded
but don't know how to accomplish this

I can walk on water when it freezes
marcus_sommer

Probably there are more things included within your expression and it might be helpful to comment everything which isn't related to the total-logic. This means to use:

count(distinct Field)
   and
count(distinct total <Dim1, Dim2, ...> Field)

afterwards you may add step by step any of the set analysis again. Like mentioned an aggr() shouldn't be necessary for this - but if you the aggr() you may need to set there and/or within any outer aggregation also an appropriate set analysis as well as using there also a total statement.