Skip to main 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.

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

Note: Actions 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.

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.

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.

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.

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

Note: Actions 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.

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.

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

Note: Actions add simplicity and are intended as an alternative to macros. Wherever Actions fulfill an intended purpose, they should be used instead of macros.
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.