Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

micsim123
New Contributor III

Row percent for subtotals in pivot table Qlik Sense

Hi!

In a Qlik Sense pivot table I want to show row percentages adding to 100 % for each row/subgroup.

Here's my pivot table:

pivot_subtotal_row_percent.png

The row percent for each year is correct. It sums to 100%.

But I also need a row total of 100% for each Study Programme. That is: in row no 3 (the B-DMD Study Programme) the percent of Females should be 27 / (27+37) = 42,2 % and not the 9,9%.

The percent is calculated with this expression:

SUM(ADMITTED)

/

SUM(total <STUDYYEAR> ADMITTED)

Any ideas?

Best regards

1 Solution

Accepted Solutions
MVP
MVP

Re: Row percent for subtotals in pivot table Qlik Sense

Try this

If(Dimensionality() = 2,

Sum(ADMITTED)/Sum(TOTAL <STUDYYEAR, STUDYPROGRAMME> ADMITTED),

Sum(ADMITTED)/Sum(TOTAL <STUDYYEAR> ADMITTED))

7 Replies
MVP
MVP

Re: Row percent for subtotals in pivot table Qlik Sense

Try this

If(Dimensionality() = 2,

Sum(ADMITTED)/Sum(TOTAL <STUDYYEAR, STUDYPROGRAMME> ADMITTED),

Sum(ADMITTED)/Sum(TOTAL <STUDYYEAR> ADMITTED))

micsim123
New Contributor III

Re: Row percent for subtotals in pivot table Qlik Sense

Hi Sunny

It works fine in Qlik Sense Desktop, but when I try it on our Qlik Sense Server solution, the percents are the same as my original one.

Could there be any differences on how the Dimensionality() function works i Desktop and Server? Borth are june 2017 release.

Regards

Michael

micsim123
New Contributor III

Re: Row percent for subtotals in pivot table Qlik Sense

Hi Sunny

Sorry about the former question - my bad. I got it to work fine on Server.

Thanks!

Michael

MVP
MVP

Re: Row percent for subtotals in pivot table Qlik Sense

I don't see any reasons for differences... can you check if you get different values for Dimensionality() function when you create it as an expression?  also do you have more than 2 dimensions here?

Capture.PNG

MVP
MVP

Re: Row percent for subtotals in pivot table Qlik Sense

Awesome!!! Please close the thread by marking correct response

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny

micsim123
New Contributor III

Re: Row percent for subtotals in pivot table Qlik Sense

I would love to make it a correct answer, but there is no Correct Answer button

in the answer ??

2017-09-06_1046.png

micsim123
New Contributor III

Re: Row percent for subtotals in pivot table Qlik Sense

Someone fixed it. Thanks!