Databases Reference
In-Depth Information
In this section, we will cover topics such as when to use Set Analysis, why you
should use it, what the correct syntax is, and we will provide common examples
and several tips and tricks for maximizing performance as well.
What is it for?
Set Analysis is a great feature in QlikView that lets you, as a developer, take control
over what your charts display and allows calculations that wouldn't be possible
otherwise, at least not as dynamically. To understand its inner workings, we can
compare it to how selections that are made using listboxes work.
With UI selections, we can say that whatever is selected affects the entire document,
and all of the charts only display information associated with the set of data
corresponding to those selections; plain and simple. In a way, that is basically what
Set Analysis does. It restricts, predefines, or extends the set of data that charts base
their calculations on. Using a set expression, we can, for instance, specify that a
certain chart should perform an aggregation only based on records that meet a set
of criteria in certain fields (for example, Region A and Region B from the Region
field), even if the non-matching values are part of the user's selected record set. We
can also use Set Analysis to expand the selections made by the user to show, for
example, results of the previous year even when it has not been actually selected.
For example, when the user selects the year 2012 and a table displays data for 2012
in one column and 2011 in the other.
The modified record set specified in a set expression affects only
the expression in which it is being used, not the entire document.
That is the whole concept. However, it is sometimes not as simple to tell our chart
to "show the numbers of the previous year/month/period" as it would be using
selections. In Set Analysis, we need to specify the modified record set using an
expression with the correct syntax.
These are some situations in which the use of Set Analysis is practical:
• To compare results for two different time periods in one single view based
on the same selection state
• To restrict or exclude certain value(s) in a field from the calculation
• To create a cumulative sum or YTD (Year-To-Date) result, even if the user
selects only one month
 
Search WWH ::




Custom Search