Using alternate states with Set Analysis

The alternate states function was introduced to QlikView in version 11. It allows us to create a named set of selections separate to the default current selections. At a simple level, this allows us to create a side-by-side analysis to allow us to easily and quickly compare one set of selections versus another. At a more complex level, it opens up a wide range of analysis possibilities.

In this recipe, we will create two states and look at how we access those states in the Set Analysis syntax.

Getting ready

Load the following script:

LOAD * INLINE [ Country, City, Year, Sales USA, San Francisco, 2011, 1245 USA, San Francisco, 2012, 3322 USA, San Francisco, 2013, 3245 USA, New York, 2011, 2765 USA, New York, ...

Get QlikView for Developers Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.