Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Restrict calculation in an expression

Hi guys,

I just wanted to know if there was any way I could restrict my calculation over a specific dimension. At the time, my calculation is the percentage considering all the elements of the dimension, but I would like to restrict them only to the individual percentage of each element.

For example:

I'm using 2 dimensions, but the calculation should be restricted only to individual elements of the dimension 'org'.

exemplo1.png

That's my calculation:

exemplo2.png

And I got this:

exemplo3.png

the calculation of the percentage is considering all the elements of the dimension, but I would like to restrict them individually.

Like this:

exemplo4.png

THANK YOU!!

1 Solution

Accepted Solutions
sunny_talwar

May be this:

Sum(perc)/Sum(TOTAL <Org> {<Status>}perc)


or

Sum(perc)/Sum(TOTAL <Org> {1} perc)

View solution in original post

5 Replies
sunny_talwar

Try this expression:

Sum(perc)/Sum(TOTAL <Org> perc)

Anonymous
Not applicable
Author

Very Good, Sunny, but when I click on the legend to perform a filter, it brings me to filter result all 100%. I would click it and bring me the exact percentage, as it appears before filtering. It's possible?

BEFORE

exemplo5.png

AFTER

exemplo6.png

sunny_talwar

May be this:

Sum(perc)/Sum(TOTAL <Org> {<Status>}perc)


or

Sum(perc)/Sum(TOTAL <Org> {1} perc)

Anonymous
Not applicable
Author

Thank you!!!

You Always help me!

sunny_talwar

Just so you know:

Expression 1) Sum(perc)/Sum(TOTAL <Org> {<Status>}perc)

The denominator will only remain the same based on selection in Status field. Other field selections will still filter the expression

Expression 2) Sum(perc)/Sum(TOTAL <Org> {1} perc)

The denominator will stay the same regardless of any selection you might make.