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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Pdmotta
Contributor III
Contributor III

Pivot Table , Sum and Average

Pivot Table , Sum and Average

Can we add a Total and an Average summaries in the same Pivot Table ?

Is there  an open object that does it ?

Something like 

__________client a client b
total _________600 267
avg __________200 800
jan/23 ________100 200
feb/23 ________200 200
mar/23 _______300 400

Thanks.

Labels (1)
  • SaaS

2 Replies
sidhiq91
Specialist II
Specialist II

@Pdmotta  You can try in the straight table. Please see the code that I have used to load the data:

NoConcatenate
Temp:
Load * Inline [
Month, client, Values
Jan,clienta,100
Feb,clienta,200
Mar,clienta,300
Jan,clientb,100
Feb,clientb,200
Mar,clientb,400
];

Exit Script;

To calculate the sum for each client type: 

for Client A: Sum({<client={'clienta'}>}Values)

for Client B: Sum({<client={'clientb'}>}Values)

You can set the total function to be as Avg

sidhiq91_0-1688809164570.png

 

sidhiq91_1-1688809191112.png

 

Pdmotta
Contributor III
Contributor III
Author

Thanks sidhiq91, but I need a pivot format with both sum and average.