Qlik Community

Qlik Sense App Development

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

pranavgohil
New 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..

Tags (2)
4 Replies
ali_hijazi
Honored Contributor

Re: how to show sum column wise in pivot table

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

hope this helps

pranavgohil
New Contributor III

Re: how to show sum column wise in pivot table

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?

ali_hijazi
Honored Contributor

Re: how to show sum column wise in pivot table

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

ali_hijazi
Honored Contributor

Re: how to show sum column wise in pivot table

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

Community Browser