Summary: Instructions on how to add a default selection to a QlikView document via a trigger.
Article Type: Information / Troubleshooting / Support
Related Product(s): This article relates to the following products:

  • QlikView

Analysis with QlikView revolves around the fact that users can make their own selections.  There are some situations where controlling the initial starting place is useful.  There are a number of mechanisms to control initial selections on documents and/or sheets.  One is by virtue of security put on a QlikView document, utilising Section Access.

The way that Section Access works is by enforcing a selection and normally reducing the data in line with that selection.  Via Section Access, the selection cannot be de-selected as it is inherently tied up with the login.  It is a method by which the designer can control the default selection and is seamless to the user.  See QlikView Help (search for “Security”).

There are occasions when you would like to set a selection to provide a standard view but without the requirement to restrict the user to only that data set in which case a trigger can achieve this goal.

Default Selection via a Trigger

It is possible to add a trigger to the document so that a determined set of selections are put in place when the document is opened.  A typical example of this is to select the current year and month.  As time progresses through the year the values for selections will change so this method is combined with the use of variables to ensure correct selections made.  Below is an outline of how to default the selections to the current month/year.

How To

The description assumes that your document includes a standard Calendar script which includes the field “Cal_MnthYr”.

Add variable to the load script.

let varCurrentMnthYr = Month(today())&’-‘&right(year(today()),4);

Then go to Settings > Document Properties > “Triggers” tab

QlikView Default Selections Triggers

Select “OnOpen” and click on “Add Action(s)” button.

Add an action with Action Type = Selection and Action = “Select in Field”

Add the field “Cal_MonthYear” and Search String = varCurrentMnthYr

QlikView Default Selections Actions

OK > OK

Close and re-open the document and the current Month/Year should be selected!

For more information on QlikView, view the QlikView Technical Support page on the QGate Knowledgebase.

Related Information: