Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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
MVP
MVP

Re: Macro after clear all

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.

6 Replies
tanelry
Contributor II

Macro after clear all

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

Macro after clear all

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.

MVP
MVP

Re: Macro after clear all

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

Macro after clear all

Thanks John. This works.

Not applicable

Re: Macro after clear all

Hello.

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

Thanks in advance.

Re: Macro after clear all

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

Community Browser