Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can you get the sum of a column in a pivot chart?

Can you get the sum of a column in a pivot chart?

16 Replies
gerhard_jakubec
Contributor III
Contributor III

number formating is off topic

gerhard_jakubec
Contributor III
Contributor III

Hi Manish, can you please describe or point to some reference how SecondaryDimensionality() can be used to solve this requirement?

gerhard_jakubec
Contributor III
Contributor III

Hi there,

i've set up an example and it looks like it works (see attachment). However i'm not sure wether there is a more efficient solution.

your feedback / opinion is welcome

P.S. there's a similar thread on topic Regarding Pivot table row wise average

MK_QSL
MVP
MVP

I mean to say Dimensionality()...

Consider that you have case of Branch, Customer and Sales data where More than one Branch is having same Customer .... COUNT(Distinct Customer) will give you total Distinct Customer using Presentation - Show Partial Sums but if you want total Customer regardless of repeating Customer more than once,,,

we can use...

IF(Dimensionality() = 0,Count(ALL Customer),Count(Distinct Customer))

Not applicable
Author

Gerhard- thanks for your example as it is good to understand. However, for my particular app, I want the total of a column for a dimension. How would I go about it differently? 


planned orders and confirmed orders are both dimensions and I used the 'Num' function to round it to a whole number.

for example:

product, planned orders, confirmed orders

               A  | 20  | 20

               B  | 10  | 0

               B  | 50  |10

------------

Total:             80 | 30


gerhard_jakubec
Contributor III
Contributor III

Hi Manish, thank's for providing the solution using Dimensionality() for given use case, this might come in handy.

gerhard_jakubec
Contributor III
Contributor III

Hi,

the solution really depends on your table structure. Is there any particular reason why you are trying to utilize "planned orders" and "confirmed orders" as dimensions (within your chart/table)? Wether this utilisation makes sense or not depends on your table structure. As i understand your case those fields containin measurement values. I do not know any way how to display a sum/total of a "dimension column". Why don't you define those columns as expressions? In order to calculate sum/total of an expression you just have to right click your sheet object, select "Properties", select the "Presentation" tab and check the "Show Partial Sums" option for the desired dimension(s).

I have made an example file which illustrates two different table structures. If you still have issues please post an example file containing your actual data model. Possibly even your data model has to be modified in order to implement your requirement.

cheers