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, 2012, 3452 USA, New York, 2013, 3321 UK, London, 2011, 2765 UK, London, 2012, 2612 UK, London, 2013, 1498 UK, Manchester, 2011, 1654 UK, Manchester, 2012, 3522 UK, Manchester, 2013, 4865 ];
How to do it...
Perform the following...