Qlik Community

Qlik Sense App Development

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

kaanerisen
Contributor III

How to make dynamic percentage calculation for each group on pivot

Hi all,

I want to show percentage %ofParentTotal for each group on pivot table. I can make it by checking dimensionality of cell and calculate the %ofParentTotal for each group.


sum(VALUE)/

Pick(Dimensionality()+1,

sum(total VALUE),

sum(total VALUE),

sum(total <DIM1> VALUE),

sum(total <DIM1,DIM2> VALUE),

)

ss.png


but I need to calculate it without checking dimensionality. Actually, I don't want to edit the expression when any dimension is added. It is not effective


Is there any way to achieve this?


Thanks,


2 Replies
MVP
MVP

Re: How to make dynamic percentage calculation for each group on pivot

I guess this is closer to what you are looking for?

2018-03-30 11_32_49-_ratio for each group - My new sheet _ App overview - Qlik Sense.png

MVP
MVP

Re: How to make dynamic percentage calculation for each group on pivot

Furthermore you can make it dynamic as to which two first dimensions you put in the pivot by using the GetObjectField() function. It is a rather strange name for the function since it retrieves the name of the dimension you select:

Sum(VALUE)/SUM(TOTAL <$(=GetObjectField(0)),$(=GetObjectField(1))> VALUE)

This expression will adjust to whichever dimensions you put in the pivot.

Community Browser