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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to use macros within a button to make selections in the list box

Hi,

I have a list box lets say which has Date and i also have a button ,Now what i need to achieve is If i click the button for the first time  it must make the selections for the date the top one and if i click the button again then it must clear my previous selection and select the next column of the date and so on.

Can this be achieved by using macros inside the Button? If so can someone help me with the code for this macros? I am new to macros and Scripting .

Thanks,

Sujith.

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Don't use macro's, use Select in Field actions instead. You can add as many actions to your button as necessary. See attached example.


talk is cheap, supply exceeds demand

View solution in original post

7 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Don't use macro's, use Select in Field actions instead. You can add as many actions to your button as necessary. See attached example.


talk is cheap, supply exceeds demand
Not applicable
Author

I think this is an answer Gysbert has provided so please mark as Answered...thanks

Not applicable
Author

Hi Gysbert,

Thanks for your help but i noticed one small thing over here, In your example as i click the next date button for the first time it skips the very first date and goes onto the next one?

Is there anything i need to change inside the search string of this action field?

Thanks,

Sujith.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can change the search string. In my example replace it with:

=if(GetSelectedCount([Transaction Date]),min({1<[Transaction Date]={'>$(=min([Transaction Date]))'}>}[Transaction Date]),min({1}[Transaction Date]))

This way it will select the next date if a date is selected and otherwise it will select the absolute minimum date, i.e. the first date in the listbox.


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks for your help,It worked fine.

Not applicable
Author

Hi Gysbert,

Sorry to bug you but is there any way where we can achieve this in macros? we already solved this one using select in field but my requirement is we need to get it done only in macros as we have plenty of such things coming down the pipeline i know we can solve all those by select in but again i have to go by the requirement.

So, can you please help me if there is any way to get it done by macros?

Not applicable
Author

Can we add multiple actions to a single button?