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
Hi Arun,
try this
=sum({1-$}[Total Value])-sum([Total Value])
Hi ,
Thank you for the quick post. Actually I tried slightly different syntax and that seems to work
Sum({1} [Value]) -Sum({$} [Value])
- this syntax is sum of all region values - sum of current region . I used this resource file:///C:/Users/hp/Downloads/Les%20set%20analysis_ENG%20(1).pdf.
Thanks again for your quick reply .
Regards,
Arun
Can this work?
=Sum({<Region=e(Region)>} [Total Value])-Sum([Total Value])
Hi Alexander,
Could please explain , what does your syntax do. I tried and it works but I couldn't understand the output. Please explain if you can .
Regards,
Arun
I would do the sum ignoring the selection on region, and then take the selected region off twice (once as it is not included and once to remove it) so;
sum({<Region=>}Value) - (sum(Value)*2)
Obviously if there is no region selected it will give you the total value as a negative (1200-2400), but you could put something around it to only show if sum({<Region=>}Value) <> sum(Value)
Using {1} in any expression will ignore all selections.
Hope that helps.
Steve
Try this
=sum({<Region=-{"$(=GetFieldSelections(Region))"}>} [Total Value])
-sum({<Region={"$(=GetFieldSelections(Region))"}>}[Total Value])
Hi Arun,
Try below code in text object,
=(Sum({<Region={'*'}>} value)-Sum({<Region={"$(=GetFieldSelections(Region))"}>} value))-Sum({<Region={"$(=GetFieldSelections(Region))"}>} value)
hope it will work.
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 1000. ( Sorry , I mentioned as 800 in my previous post . )
Hi Arun,
How can you get (sum(400+500+100)- 200) =1000
But then to if you want the value which excludes selected Region then use
=(Sum({<Region={'*'}>} value)-Sum({<Region={"$(=GetFieldSelections(Region))"}>} value))
IE. sum(South+West+East)
sum(400+500+100)=1000