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

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

Multiple field value select in macro

I have a listbox containing "CalendarDate". I want to add a button that uses a macro that allows the user to select a date in the listbox, and then click the button to also select the 11 prior dates in the listbox. So, if the user selects "5/1/2016", and then clicks the button, the 11 preceding dates in the listbox will also be selected.

How do I accomplish this?

5 Replies
Not applicable
Author

Hey John,

Are those date consecutive? Or there may be some gaps (missing dates) in the listbox?

BR,

Kuba

Anonymous
Not applicable
Author

They're assumed to be consecutive (each date represents the 1st day of each month). The list is sorted in descending order with the most recent date being displayed first.

Not applicable
Author

Hello John,

Please see attached app.

Considering the field is named "Date", I have created a button and added "Select in Field" Action into it:

Field:

Date

Expression:

='>'&Date([Date]-12)&'<='&Date([Date])

PS Button is active only if 1 value is selected in Date listbox.

BR,

Kuba

Anonymous
Not applicable
Author

I had to make a change, given that the dates are always the first of the month, but in general, it worked:

='>'&AddMonths(Date([CalendarDate]),-11)&'<='&Date([CalendarDate]

Many thanks.

Not applicable
Author

Hey John,

Glad it worked for you! Please mark question as answered.

BR,

Kuba