top of page

Qlik Set Analysis

  • Zdjęcie autora: Przemysław Blicharski
    Przemysław Blicharski
  • 24 sty 2024
  • 1 minut(y) czytania


Set analysis in Qlik scripting is a powerful way to perform complex data aggregations and comparisons. It allows you to define a subset of your data for aggregation, independent of the user's selections in the application. This is particularly useful for comparative analysis, like comparing sales of this year to the last year, or analyzing a specific set of products regardless of other filters applied by the user.


Here's a basic breakdown of how set analysis works in Qlik:

  1. Basic Syntax: The basic syntax of set analysis consists of two parts: the identifier and the set expression. It looks something like this: Sum({<SetExpression>} FieldName). The set expression is enclosed in curly braces {}.

  2. Identifiers: Identifiers define the basis of comparison. Common identifiers include:

  • $ (current selection)

  • 1 (full set of all data)

  • _ (record with no selections)

  • Bookmark01 (a specific bookmark)

  1. Set Expression: This is where you define the actual set. It includes field names and their corresponding values, for example, {<Year={2023}>}. This expression selects records from the year 2023.

  2. Operators: You can use operators like +, -, *, / to combine sets. For example, {<Year={2023}> + <Year={2022}>} would include records from both 2023 and 2022.

  3. Advanced Set Analysis: You can create more complex expressions, like nested aggregations, indirect set analysis (using $- for all but current selection), and using variables in set expressions.

  4. Practical Uses: Some common uses of set analysis are:

  • Comparing data across different time periods

  • Aggregating data that meets certain criteria, irrespective of current selections

  • Performing what-if analysis

  1. Example:


Understanding and mastering set analysis can significantly enhance your Qlik scripting capabilities, allowing for more dynamic and flexible data analysis. Remember, the key is in defining the right set to analyze based on your specific data and business questions.


 
 
 

Comments


bottom of page