Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am working in Qlik Sense, I have a ratio that I want to calculate comparing a line item measure to the subtotal of a different measure for the dimension.
Dimension A - Value 1
Measure 1 Measure 2 Desired Result
Item 1 10 20 10/100 = 10%
Item 2 20 30 20/100 = 20%
Item 3 10 50 10/100 = 10%
40 100 40/100 = 40%
Dimension A - Value 2
Measure 1 Measure 2 Desired Result
Item 1 15 20 15/100 = 15%
Item 2 30 30 30/100 = 30%
Item 3 5 50 5/100 = 5%
50 100 50/100 = 50%
This is the only way I have found to have the divisor be the sum of Measure 2 across the Dimension Value
SUM ( Measure 1 ) / SUM(TOTAL <Dimension A> Measure 2 )
Unfortunately, this requires me to declare an explicit value for Dimension A, is there a way to select the Dimension dynamically based on the Dimension the chart (Object) the expression is used in? Otherwise I fear I will have to declare it for each Dimension I want to use it in.
I use this syntax : ="$(=vDimension)"
Remember ! You need to start the expression with an equal sign.
I figured it out, needed to use '$(vName)' instead of just 'vName'
I hadn't updated to see your response yet, THANK YOU!