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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Trigger that would clear a specific variable when a specific field gets cleared

Hello all,

I am trying to figure out a way to set up a trigger so that when a specific field gets cleared, it clears a variable as well. The "On select" trigger will seemingly do the job correctly as long as the field that I clear is the only one that currently has a selection. I don't really understand that, but in any case, it is not sufficient. Does anyone know of a way to do this without the use of a macro?

1 Solution

Accepted Solutions
Digvijay_Singh

I was checking with onchange event of the field, it looks like it is working as you are expecting. Pl check this sample and let me know if I am missing something. I have added on change trigger as well on select trigger on product field, didn't try yet if it works with only onchange. You can use inputfield object to change variable value for testing.

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Maybe try:

OnSelect trigger for that specific field

Set Variable action -

=if(GetSelectedCount(YourField)=0,'',$(YourVariable))

Not applicable
Author

Like all of the other stuff I've tried, this only works as long as the field that I clear is the only one that currently has a selection. I'm stumped as to why that is the case, though.

Digvijay_Singh

I was checking with onchange event of the field, it looks like it is working as you are expecting. Pl check this sample and let me know if I am missing something. I have added on change trigger as well on select trigger on product field, didn't try yet if it works with only onchange. You can use inputfield object to change variable value for testing.

Anonymous
Not applicable
Author

My try off of Digvijay's example.

This works the way I think you want.