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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
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
qlikviewalex
Contributor III
Contributor III

Hi Arun,

try this

=sum({1-$}[Total Value])-sum([Total Value])

arunqlik2view
Creator
Creator
Author

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

Anil_Babu_Samineni

Can this work?

=Sum({<Region=e(Region)>} [Total Value])-Sum([Total Value])

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
arunqlik2view
Creator
Creator
Author

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

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

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

shiveshsingh
Master
Master

Try this

=sum({<Region=-{"$(=GetFieldSelections(Region))"}>} [Total Value])

-sum({<Region={"$(=GetFieldSelections(Region))"}>}[Total Value])

Anonymous
Not applicable

Hi Arun,

Try below code in text object,

=(Sum({<Region={'*'}>} value)-Sum({<Region={"$(=GetFieldSelections(Region))"}>} value))-Sum({<Region={"$(=GetFieldSelections(Region))"}>} value)

table.PNG

hope it will work.

arunqlik2view
Creator
Creator
Author

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

Anonymous
Not applicable

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