Skip to main content Skip to complementary content

Defining QSL selections with Set handles

Set handles are intended to capture the state of Qlik Sense selections mapped to a Qlik Big Data Index object model. Set handles in Qlik Selection Language are based on a result of Set Analysis expression.

Set handle definition syntax

set-handle-declaration ::= 'SET' {ScopeQualifier'.'} HandleName '=' Set Analysis Expression

The <Set Analysis Expression> is the Set Analysis syntax used under Aggregation functions Qlik Expressions, with minor extensions for QBDI.

Qlik Big Data Index-specific extensions of Set Analysis grammar

The Set Analysis grammar contains the following extensions for Qlik Big Data Index:

  1. The ability to assign the result of a Set expression to a variable, the Set handle.
  2. Selection Handle reference is accepted in the syntax constructs that allow for Alternate State and Bookmark references.
  3. Qualifiers in Selection Handle (Alternatice State) references. Specifically, the Model Name qualifier is needed in cases when the default model is not set or should be overridden in a given execution scope.
  4. Element lists can be marked as containing symbol IDs instead of symbol values with the element-list prefix "#".

Set Analysis grammar

The following grammar is the grammar for Qlik Set expressions with the changes specific to Qlik Big Data Index shown in bold type.

The full syntax (not including the optional use of standard brackets to define precedence) is described using Backus-Naur Formalism:.

Syntax:  

set-expression ::=

'{' set-entity '}'

 

set-entity ::=

set-identifier [ set-modifier ]

| '('set-expression')'

 

set_identifier ::=

model-name '.' '1' | selection-handle-reference

 

set-operator ::=

'+' | '-' | '*' | '/

'

 

set-modifier ::=

'<' field-selection {',' field-selection } '>

'

 

field-selection ::=

field-name [ '=' | '+=' | '–=' | '*=' | '/=' ] element-set-expression

 

element-set-expression ::=

element-set { set-operator element-set }

 

element-set ::=

['#'] '{' element-list '}' | element-function

| '(' element-set-expression ')'

 

element-list ::=

element { ',' element }

 

element-function ::=

( 'P' | 'E'

) '(' [ set-expression ] [ field-name ] ')

'

 

element ::=

field-value

 

Referencing symbol IDs

Qlik Big Data Index assigns every symbol a numerical ID. Qlik Big Data Index uses symbol IDs for more efficient interaction with Qlik Big Data Index clients, specifically for interaction with the Qlik associative engine.

Symbol IDs can be passed within QSL statements. The following example filters on P_NAME values with symbol IDs 1,2,4. Symbol IDs are zero-based.

Example:  

SET H2 ={[TPCH].1<P_NAME = #{1,2,4}>}

Examples of Handle definition statements

The following queries show the pattern of set analysis operations required to support Qlik Sense selection manipulation gestures.

SET H1 = {[dbgen10gb].1 <REGIONKEY = {3,4}>} //Setting initial selections

SET H2 = {H1 <PRODUCTKEY = {1,2,4}>} //Further selections set in a different column

SET H3 = {H2 <REGIONKEY /= {2,15}>} //Toggling selection state for values 2,15

 

SET H4 = {H2 <REGIONKEY = P({H2} REGIONKEY)>} //"Select Possible" action

SET H5 = {H2 <REGIONKEY = E({H2} REGIONKEY)>} //"Select Excluded" action

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!