Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Question on set analysis, percentage of subtotal

Hey folks,

Trying to learn about set analysis by working on a KPI element.

To illustrate I made some sample data:

 

BrandModelMeasure
xa1
xa2
xb3
yc4
yc5
yc6

I want to create a KPI that shows the "percentage of subtotal" based on what brand or model I select. So if I select "Model=b" I want the KPI to show the percentage of subtotal for brand x. ie 3/6=50% but so far I have only been able to figure out how to calculate the percentage of the TOTAL for all brands giving me 3/21=14% using Sum(Measure)/Sum({1}Measure)

Any ideas from you clever people?

/Andreas

5 Replies
sunny_talwar

Try this:

Sum(Measure)/Sum({<Model, Brand = p(Brand)>}Measure)

swuehl
MVP
MVP

Maybe like

Sum(Measure)/Sum({<Model=, Brand=p()>} Measure)

Not applicable
Author

You may also create straight table with dimension, brand and model, and expression, SUM(TOTAL<Brand,Model>Measure)/SUM(TOTAL<Brand> Measure) to show KPI for all brand/model in the table together.

effinty2112
Master
Master

Hi Andreas,

                         What about this pivot table with expression: Sum(Measure)/Sum(TOTAL <Brand> Measure) ?

Model Brand xy
a 50%-
b 50%-
c -100%

Cheers

Andrew

Not applicable
Author

Thanks a lot for the replies guys! The p() function did the trick this time.

/Andreas