Using embedded functions in Set Analysis
As you have seen in the previous recipes, we have used functions, such as Max()
and GetFieldSelections()
inside our Set Analysis. Embedding functions inside a Set Analysis expression, specifically in the rules area that defines the set of records we want to calculate across, is known as Dollar-sign expansion.
A set of records in the simplest literal form is defined as Year= {2015}
.
The expression needs to know the year you want to use and dollar sign expansion allows us to generate the text dynamically. Understanding how to use dollar sign expansion in your Set Analysis expressions enriches the amount of analysis you can perform. Sometimes, just using the function alone or specifying literals in Set Analysis is either too time-consuming or adds unnecessary maintenance to the application.
Getting ready
For the purpose of this recipe, we make use of product sales data as defined in the following script. Load the following data into the Qlik Sense Data load...