Skip to main content Skip to complementary content

Invoking macros

You can invoke different types triggers as macros for document, field, variable, sheet and button events.

Invoking macros on document, field and variable events

To invoke macros on document events, field events and variable events, open Document Properties and then select the Triggers tab.

Document Properties dialog, with selected Document Event, Field Event, and Variable Event Triggers

From the Add Action dialog you find actions that runs a macro among the external action types.

Information noteActions add simplicity and are intended as an alternative to macros. Wherever Actions fulfill an intended purpose, they should be used instead of macros.

Document Event Triggers

In this group you can set macros to trigger on selected events in the document.

Document event triggers
Trigger ID Trigger description
OnAnySelect A run macro action, if added, will be executed each time a selection has been made in any field of the QlikView document.
OnOpen A run macro action, if added, will be executed each time the QlikView document is opened.
OnPostReduceData A run macro action, if added, will be executed after each time the Reduce Data command has been executed.
OnPostReload A run macro action, if added, will be executed each time the script has been re-executed.

Field Event Triggers

In this group you can set macros to trigger on changes in the logical state of a specified field in the application. You must first select a field in the list before you may assign macros to events in it.

Field event triggers
Trigger ID Trigger description
OnSelect A run macro action, if added, will be executed each time a selection has been made in the selected field.
OnChange A run macro action, if added, will be executed each time a selection has been made in any field which is logically associated with the selected field.
OnLock A run macro action, if added, will be executed each time the field is locked.
OnUnlock A run macro action, if added, will be executed each time the field is unlocked.

Variable Event Triggers

In this group you can set macros to trigger on changes in the contents of a specified variable in the document. You must first select a variable in the list before you may assign macros to events in it.

Variable event triggers
Trigger ID Trigger description
OnInput A run macro action, if added, will be executed each time a new value is directly entered in the selected variable.
OnChange A run macro action, if added, will be executed each time the value of the selected variable changes as a result of changes in other variables or the logical state of the application (typically applies when the variable contains a formula).

Invoking macros on sheet events

To invoke macros on sheet events, open Sheet Properties and then select the Triggers tab.

Sheet Properties dialog, Triggers tab

From the Add Action dialog you find actions that runs a macro among the external action types.

Information noteActions add simplicity and are intended as an alternative to macros. Wherever Actions fulfill an intended purpose, they should be used instead of macros.

Sheet Event Triggers

In this group you can set macros to trigger on change of active sheet.

Sheet Event Triggers
Trigger ID Trigger description
OnActivateSheet In this dropdown list you can select from existing macro names or type any name which you later create a macro for in the Edit Module dialog. The macro, if it exists will be executed each time the sheet is activated.
OnLeaveSheet In this dropdown list you can select from existing macro names or type any name which you later create a macro for in the Edit Module dialog. The macro, if it exists will be executed each time the sheet is deactivated.

Invoking macros with sheet object buttons

To invoke macros on sheet object button events, open Button Properties and then select the Actions tab.

Button Properties dialog Actions tab

From the Add Action dialog you find actions that runs a macro among the external action types.

Information noteActions add simplicity and are intended as an alternative to macros. Wherever Actions fulfill an intended purpose, they should be used instead of macros.
Macro properties
Macro property ID Macro property description
MacroName In this textbox you input any existing macro names or type any name which you later create a macro for in the Edit Module dialog. The macro, if it exists will be executed when the button is pressed.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!

Join the Analytics Modernization Program

Remove banner from view

Modernize without compromising your valuable QlikView apps with the Analytics Modernization Program. Click here for more information or reach out: ampquestions@qlik.com