Databases Reference
In-Depth Information
• To disregard selections in a certain field that may not be applicable to
calculate a particular metric
• To essentially ignore all selections
• To use the set of data returned by a Bookmark, even when the Bookmark is
not activated
• To replace If expressions that make use of lots of hardware resources
• A mix and match of all of the above
We will first work our way through the Set Analysis syntax, after that we will
apply the concepts to achieve something that is a must in almost every QlikView
document: Point In Time Reporting.
Syntax and examples
The details for creating a set expression are outlined in the following
step-by-step procedure:
1. We start off by defining the base expression. Say we want to sum the total
number of flights performed. So, we will begin with the following:
Sum([# Departures Performed])
2.
Then, we need to construct the set part of the expression. It is the set
expression in which we specify the record set we want to use in our
calculation. The set definition is placed just after the first parenthesis in the
base expression, before the field name, and will be enclosed in curly brackets:
Sum({set expression} [# Departures Performed])
3. After the first curly bracket, we define a set identifier by adding either a
dollar sign (which means the alternative record set will be initially based on
the current selections), the number 1 (meaning we will use the full record
set of all the data contained in the document, ignoring all user selections) or
the ID of a bookmark (which uses the selection stored in the bookmark). To
illustrate our example, we will use the dollar sign identifier, since it is the
most common. We will now have:
Sum({$} [# Departures Performed])
Note that the dollar sign can be omitted, since it is the
default identifier, and the set expression will not be affected.
However, it is good practice to use it to maintain consistency.
 
Search WWH ::




Custom Search