Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
michael_klix
Creator II
Creator II

How to notify user if a selection was changed from default

This is my problem today:

I created an app with an action in a button that does a selection based on the value of a variable.

Let's say the variable is "Age" and the field is "Employee". In an input-box, the user enters any value for "Age" and then the button selects all employees where "employee_age" is below "Age". 

Now we have selected a group of employees to start from. Of course the user can change this selection manually.

Now the point:

How can I show the user that his selection differs from the original selection, made via the button?

 

Note that my original app is significantly more complex. I just want to avoid that the user thinks the optimized selection is still used while for some reason, it has changed. Unfortunately it is not just the number of selections or a sum, but the exact list of selections in a field, which may be in the range of some 10k distinct values.

 

Any ideas?

 

 

 

Labels (4)
2 Replies
chrismarlow
Specialist II
Specialist II

Hi,

You could try the attached.

Basically 2 macros accessing a variable, one triggered with the button and one on any selection change. The one on the button resets the counter. The text box the shows 'Button Selection'/'Selection Changed' depending on the variable;

20190327_1.png

20190327_2.png

Sub Reset()
	ActiveDocument.Variables("vFilterState").SetContent 0, true
End Sub

Sub Increment()
	lFilterState=ActiveDocument.Variables("vFilterState").GetContent.String+1
	ActiveDocument.Variables("vFilterState").SetContent lFilterState, true
End Sub

Probably needs some tweaking & the variable reset on opening, but may help.

Cheers,

Chris.

michael_klix
Creator II
Creator II
Author

Hi Chris,
Thanks for your thoughts. Unfortunately, we cannot use macros on our server and there is a second limitation that I did forget to mention: The solution must be portable to SENSE, where we do not even have triggers as far as I am aware ...
Just had a totally different idea. Maybe we can simply use something like a "lock selection" function managed by a button and standard variables? As soon as the user presses the button "define optimal selection", all selections are made and locked. If the user wants to change the selection, the button changes to "unlock optimal selection" and the user can now make changes. As long as the selection is Unlocked, a variable "v_locked" is 0 and displays a message "manual selection, potentially sub-optimal ! ".
The question here would be...can we lock a field in Sense like we can in View?
- Keep qliking -
Michael