Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
melwilson
Contributor II
Contributor II

Calculations containing set analysis in Pivot table

Hello.

I am having a problem with set analysis in a pivot table.

I have created a small table with two out of many KPIs:

KPI          Amount

A             150

B             280    

Total        430

Using KPI as a dimension and  the expression:

sum({<KPI = {,} >} Amount)

and then clicking on showing partial sum to get Total at the bottom.

I am using another expression to try to get another column to show the amount for both A and B as a percentage of another KPI.

When I try to calculate it as a percentage of another KPI I am having problems.  I want to try and get this:

KPI          Amount      Percentage

A             150               3.7%

B             280               7%

Total        430

However, its is coming out as

KPI          Amount

A             150

B             280    

Total        430          10.8%

The expression I am using is:

=num(sum({<KPI = {,} >} Amount)

/

sum({<KPI = {} >} Amount),

'#,#%')

How do I use set analysis to get the percentages against each KPI instead of only as a total ?

Thanks for any help you can suggest.

Mel

1 Solution

Accepted Solutions
sunny_talwar

Try this

=Num(Sum({<KPI = {,} >} Amount)

/

Sum(TOTAL {<KPI = {} >} Amount),

'#,#%')

View solution in original post

2 Replies
sunny_talwar

Try this

=Num(Sum({<KPI = {,} >} Amount)

/

Sum(TOTAL {<KPI = {} >} Amount),

'#,#%')

melwilson
Contributor II
Contributor II
Author

Hi, Sunny.

That is perfect.

Thankyou for responding so quickly. It has really helped me out.

Mel.