This post will be dealing with only the basic syntax. Personally, I found the syntax to the Qlik set analysis to be not intuitive at first. I am attempting to discuss the basics of its syntax. First, however, let’s talk why we would use a set analysis.
Set analysis is used for data already loaded in a Qlik app. So, it is part of a function tied to a chart object. It selects a portion of the current data set based on certain rules and syntax. The easiest way to create a set analysis is to build it from the outside working in.
{ … } — The entire set analysis is contained within curly brackets.
{ $/1/BM01 …. } — Set identifiers are next. $, 1, or BM01 are mutually exclusive. $ is the default and sets the initial recordset to be take into account anything the user has selected. 1 indicates the set analysis will include everything originally loaded regardless of what the user has selected. BM01 is representing a bookmark. Qlik allows the user to store a custom selection of data into what is called a bookmark. Set analysis can retrieve these custom data selections and perform additional selection on it.
{ $/1/BM01 < … > } — The selection field list is contained in the angle brackets.
{ $/1/BM01 < FieldName1 = {Value1}, FieldName2 = {Value2} > } — One or more fields can be added to the selection criteria. There are a couple syntax rules that we need to know. First, the values are in braces {}. Second, text values are enclosed in single quotes ”.
Third, search text are enclosed in double quotes “”. Search text is a broad term. This includes a wildcard such as * in “Donnie*”. This would match ‘Donnie’, ‘Donnie Bryson’, ‘Donnie Smith’, or any other combination. There is another type of search that is relationships. For example, { $< Children = {“>=1”}>} would select every record that the number of children is greater than 1.