Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Suppose if I have column called Region
Region | Total Value |
---|---|
North | 200 |
South | 400 |
West | 500 |
East | 100 |
If I choose North , then in a text box I should get calculation as (sum(South+West+East) - North)
(i.e) (sum(400+500+100)- 200)
and the answer should be 800.
Please advise.
Regards,
Arun
How come (sum(400+500+100)- 200) = 1000?
So you want the value excluding the selected, rather than the value with the selected value removed?
The code I posted above (and the reasoning) is all correct, just don't double count the selected value:
sum({<Region=>}Value) - (sum(Value))
That gives you the total ignoring any region selections, less the total of the selected.
Steve
It's actually sum of all regions - anyone current selection of region , in this example I chose 'North' . So the equation would be (Sum(400+500+100+200) - 200) = 1000.
I was in the hurry. My apologies for the confusion. Also, I got it worked by using this formula
Sum({1} [Value]) -Sum({$} [Value]).
Please close the thread
The same could be simplified like:
Sum({1-$} [Value])
Does this always give the value you want? Your question asked that if you selected a region the sum of the other regions is shown. The code you have there will also include values excluded for other reasons - for instance if you select month.