Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
arunqlik2view
Creator
Creator

How get the list of fields NOT GetCurrentSelection

Hi All,

Suppose if I have column called Region

RegionTotal Value
North200
South400
West500
East100

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

15 Replies
shiveshsingh
Master
Master

How come (sum(400+500+100)- 200) = 1000?

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

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

arunqlik2view
Creator
Creator
Author

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]).

shiveshsingh
Master
Master

Please close the thread

tresesco
MVP
MVP

The same could be simplified like:

Sum({1-$} [Value])

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

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.