Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for
Did you mean:
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 ?

Mel

1 Solution

Accepted Solutions
MVP

Try this

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

/

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

'#,#%')

2 Replies
MVP

Try this

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

/

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

'#,#%')

Contributor II
Author

Hi, Sunny.

That is perfect.

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

Mel.

Community Browser