Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have below data:
Class1 = 11
Class2 = 15
Note : sum of values of class1 must be multiplied by 1
And sum of values of class2 must be multiplied by -1
Currently I am using set analysis expression as below to get the desired data:
Sum({< class = class1 >} value) + (sum({< class = class2>} value))*-1
How do I merge this two sets into one set analysis expression ?
Set analysis within a single expression won't work because set analysis within a single expression cannot dictate if a range needs to be multiplied by 1 and the other range by -1... Either you have to use the if statement provided by @StarinieriG or use it as 2 set analysis expression like you have listed.
Hi
try to use
Sum(If(class='class1',1,-1)*value)
instead of set analysis
Let me elaborate more on this:
I have dynamic set parameters passed in my set analysis.
Abv thing which i had mentioned is just for illustration purpose.
I have set analysis expression as
Sum({< class = { $(class1), $(class2)} , year = max(year), version= 15>}, value)
But this gives me wrong value since this expression directly sums up two classes .
But my requirement is to multiply first passed classby 1 and second one by -1.
Class1 and class2 are variable and are dynamic
Set analysis within a single expression won't work because set analysis within a single expression cannot dictate if a range needs to be multiplied by 1 and the other range by -1... Either you have to use the if statement provided by @StarinieriG or use it as 2 set analysis expression like you have listed.
Ok. Thanks