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

Announcements
April 13–15 - Dare to Unleash a New Professional You at Qlik Connect 2026: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set default field selection using variable - possible??

Hi,

I want to write a macro which will do two things:

1. Clear all selections (I know how to do).

2. Set a field selection based on the content of a variable.

    Example: I want to do something like this

    set = vYearSel = '2016'      -> in load script

    ActiveDocument.Fields("year").Select $(vYearSel)     -> in macro.

When I ran it, the macro failed to parse.   If I hardcode the value in the macro, it will work which isn't what  I want.

Anyone know how I can accomplish this?

Thanks!!

20 Replies
Anonymous
Not applicable
Author

As it turns out, restoring multiple values isn't so obviously when using Action -> Select in Field.  It specifically requires the format of (x|y).  I had to dip through many articles and finally found it.  But that's the QV requirement.