This is an introduction to a series of articles that will cover Qlik Sense set analysis in full to provide a complete guide. In this introductory article we will cover what set analysis is and provide an example of the most basic syntax. The following articles will dig much deeper into each aspect of set analysis, including:

What is set analysis

Set analysis is the use of set expressions to analyse data. Set expressions are expressions written inside or outside aggregation functions to restrict the analysis to a specific set of values that are either independent of the current selections in the app or filter the current selections down further. This is particularly useful for limiting data in visualisations from what the app contains to highlight a point, such as a KPI showing the sales during the current month. It’s also useful for comparative analysis, such as a KPI showing year-on-year sales.

The most basic set analysis syntax

Understanding the set analysis syntax fully and being able to apply it to write the expression you need involves understanding many parts. The rest of the articles in this collection will help you do that, but below, we will demonstrate the most basic set analysis syntax.

Sum(${<[Date.Calendar.Year] = {2023}>} [Revenue])

In this example:

  • Sum – is the aggregation function
  • $ – the identifier telling Qlik that we want the set analysis to respond to current selections of the app
  • [Date.Calendar.Year] – is the field we are filtering by, a modifier
  • = – an operator specifying that the modifier [Date.Calendar.Year] should equal to the value specified after the ‘=’
  • {2023} – is the value we are filtering [Date.Calendar.Year] by, a modifier
  • [Revenue] – is the field we are summing

Essentially, you have some aggregation function inside which you write a set expression with some parameters to narrow down what you want to aggregate. In this example, we are limiting the dataset to the year 2023. Note that set expressions can also be written outside of the aggregation function. See Set Analysis: Inner vs Outer Expressions for more information on this.