Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

how to show sum column wise in pivot table

hello community,

so here's my problem i want to show sum of amount based on the code and in the year name field

example:

code,name     fy year name

                         2017-18

31                         -

41                         -

51                    767503.8

61                    84231

total of 51,61   851734.8

71                    1021542..

81                    309308

          <and so on>

so can anyone help me how can i achieve this

for now my measure is simply sum(amount)

balsheet.PNG

Please help me with this..

4 Replies
Highlighted
Partner
Partner

sum(aggr(sum({<code={31,41,51,61,71}>}amount),year))

hope this helps

I can walk on water when it freezes
Highlighted
Contributor III
Contributor III

yess  thanks its true we are halfway there,

i used it this way :

sum({<Code={51,61}>}aggr(sum( {<Code={51,61}>} Amount),[FY Year Name]))

but its showing me the sum in the field of 51 - balsheet 2.0.PNG

is there any way i can put total field horizontally below 61 in this table?

Highlighted
Partner
Partner

in the Dimension definition put if (match(code,'51','61'),'Total', code)

I can walk on water when it freezes
Highlighted
Partner
Partner

or you can add a new column in script

let's say Code_2

and you put if (match(code,'51','61'),Total,code) as Code_2

and in the chart you use Code_2 instead of Code

I can walk on water when it freezes