Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro after clear all

All,

I would like to initiate a macro after user clicks on default clear all button. I need to select a value from a field after user clicks on clear all button. We can't use the always one selected value on the list box properties since user do has to clear that every time they need to select some other value. Any ideas on how to capture clear all action in a macro and to select a value from one of the fields.

Thanks in advance.

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

Works for me.  The attached example selects product A on a clear by using the OnAnySelect trigger in the document properties.  Now, it does the same thing if you clear all selections one at a time, because it isn't detecting the button press, but just that selections have changed and nothing is selected.  But it's probably what we'd want in most applications.

View solution in original post

6 Replies
tanelry
Partner - Creator II
Partner - Creator II

There is a solution proposed in this post: http://community.qlik.com/message/114240#114240

However, if macro is just needed to make selection then you could get away with pure actions instead of macro.

Not applicable
Author

Tanel,

Thanks for your response. But the post you mentioned is not working for me. I tired this before posting this message. Not sure why. Appreciate if some one can make it little bit clear. I need to select a value after user does clear all using default clear all button.

johnw
Champion III
Champion III

Works for me.  The attached example selects product A on a clear by using the OnAnySelect trigger in the document properties.  Now, it does the same thing if you clear all selections one at a time, because it isn't detecting the button press, but just that selections have changed and nothing is selected.  But it's probably what we'd want in most applications.

Not applicable
Author

Thanks John. This works.

Not applicable
Author

Hello.

It's possible to get the same result without use any macro? using only triggers?

Thanks in advance.

marcus_sommer

You could check selections and also the missing of selections in a variable global per getcurrentselections() or in detail per getfieldselections() or getselectedcount() - simply: if(len(getcurrentselections()) < 1, 'no selections', 'any selections') - and then put an OnChange-Trigger on these variable.

- Marcus