Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Action on selection of an excluded value (or on clear field selections)

Here is a puzzle to solve.

User makes selections in fields A, B, C, etc.  After making selection in the field A, user selects in field B.  User is allowed to select a value in B which is excluded by selection in A.  I need to catch this situation somehow. 

I wish there was an action “selection of excluded value”.

When an excluded value is selected in the field B, the selection in field A is cleared.  Maybe there is a better chance to catch this event, but I didn’t find yet how to do it either.

Appreciate any ideas, preferably without macro, but for now anything goes.

Thank you,

Michael

1 Solution

Accepted Solutions
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Michael,

how about this idea? Use an Action triggered off the OnChange event for the field A and set a variable to a certain value every time the current selection of the field is different (bigger/smaller) than the previous. I'm attaching a "straw man" for this approach.

I'm not surprised that the macro doesn't work in AJAX - most macros don't work in AJAX...

Oleg

View solution in original post

9 Replies
Not applicable
Author


Pl find attached Qvw.

Let me know if it meets you requirment

tresesco
MVP
MVP

Hello Michael,

May be you can try to create a listbox using e(), which would give you excluded values. Or, even you can try alternate state in combination to that.

Anonymous
Not applicable
Author

Kirti,

Although it is not what I'm looking for, your example has a useful hint.  I can create a table, and if the number of rows = 0, this is the situation I need to catch.

Thanks,

Michael

Anonymous
Not applicable
Author

Yes tresesco,

This is exactly what I've been trying.  Created a list box for each field used for selections, and each in its own alternate state to allow mutually exclusive selections.  With the chart idea, it maybe an acceptable solution.

Thanks,

Michael

Anonymous
Not applicable
Author

Update:

Works, but not in web view.  Macro, where I check the number of rows in the staright table, simply refuses to start, although it is a safe macro, no need for system access.  It doesn't start even from a button in the web view.  Macro works fine if test it from Module, in the same web view.

Looking into other options...

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Michael,

how about this idea? Use an Action triggered off the OnChange event for the field A and set a variable to a certain value every time the current selection of the field is different (bigger/smaller) than the previous. I'm attaching a "straw man" for this approach.

I'm not surprised that the macro doesn't work in AJAX - most macros don't work in AJAX...

Oleg

Anonymous
Not applicable
Author

Hi Oleg,

I got it to work with something rather similar to your idea.  My situation is in fact simpler than that, because only one value is selected in field A.  So, if it is canceled by another selection - nothing is selected in A.  Hence, the condition is:

if(GetSelectedCount("A")=0,...,...)

And, no need for macro, alternate states, Auxiliary front end table.  Just to make sure that the selection order works correctly.

Marking your answer as correct - it is the closest to the actual solution.

Thanks,

Michael

PS: Macro in Ajax - I didn't expect much, but simple selections could've worked

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

PS: Macro in Ajax - I didn't expect much, but simple selections could've worked


Yes, I know... totally agree...

Anonymous
Not applicable
Author

Some follow-up...

I've created a small example of the solution, and posted here:
Clear all selections if mutually exclusive selections requested by URL