Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
kishorj1982
Creator II
Creator II

Clear list box selections based on List box in other state

Hello

I have a list box which has values selected and appended based on the Same list box in diff state. Now, I am implementing functionality which would remove the selected fields based on the selection in list box from other state.

For this I am using this expressions:

='=Sum({[StateB]-[StateA]} 1)'

basically it would just remove the selections made in State A in the List box of State B. This works fine till the time we are not interfering with the Other selections in the document as its taking all the selections from both the states in consideration.

Is there any way where we can Add the selections only specific to the Fields not all the related selections in the Doc?

Please let me know how to introduce specific Field in the expression above.

9 Replies
sunny_talwar

I think swuehl‌ is the one who got you the expression, he would be the best person to help you resolve the issue. Cause to tell you the truth, I have no idea what the expression did

swuehl
MVP
MVP

Yes, I think I did created the original expression for adding values.

Not sure if I understand the issue though. Could you post a small sample QVW?

sunny_talwar

One day, I am going to pick your brain and steal all your knowledge Stefan

kishorj1982
Creator II
Creator II
Author

Yes Stefen,

We discussed and you have given solution in : Concat Issue

Now I need to do reverse - i.e. selections from field  File in State A will be removed from field  File in State B.

I have introduced another button - Remove From List-2  in the QVw as well.


Please look in.

kishorj1982
Creator II
Creator II
Author

Please note that the expression I suppose to use is : ='=Sum({-} 1)' 

while removing the selections from State B based on State A --  I forgot to change it in  ' button - Remove From List-2'

swuehl
MVP
MVP

Shouldn't it be

='=Sum({B-A} 1)'

( state B minus state A)?

If I change to this search string, the app seems to work, or could you point me to a scenario where it's not working?

kishorj1982
Creator II
Creator II
Author

Yes Stefen - Its working - but in real life scenario , where I have many list box selections in State A which are valid- If user changes those selections, then the State B- A combination also changes. And the selection in File List box in state B is not associated with the selections in changed State A.

Basically if I understand your expression right, you are substarcting total selections of State b - A.  Where In I am interested in only the Selections of Field FILE in both the states.

Please suggest

swuehl
MVP
MVP

Still I don't understand the issue without seeing it. Could you extend your sample with more fields so you can reproduce the issue with the sample?

If you want to restrict the set modifier to field FILE, try maybe

='=Sum({B<FILE -= A::FILE>} 1)'

in your button action

kishorj1982
Creator II
Creator II
Author

Stefen - 

100000 times Hats Off to you.  By the way I have 0% understanding of this expression. But its working fine. I will test further and let you know.

Please suggest me the sources for these advanced expressions for Alternate states.  I dint find any suitable books.

Thanks again.