30 expressions
Advanced P() / E()

Excluded Values E()

Countries that are NOT in the list 'USA', 'Canada' (Excluded values function).

Sum({$< Country=E({1< Country={'USA','Canada'} >} Country) >} Sales)
Details →
Advanced Assignment

Field Extend (+=)

Adds year 2025 to the current selection in the 'Year' field.

Sum({$< Year += {2025} >} Sales)
Details →
Advanced Assignment

Field Intersect (*=)

Keeps only the intersection of the current 'Year' selection with 2025.

Sum({$< Year *= {2025} >} Sales)
Details →
Beginner Basic

Fixed Value

Overrides any selection and hardcodes Country to 'USA'.

Sum({$< Country={'USA'} >} Sales)
Details →
Intermediate Null Values

Force Non-NULL

Excludes records where 'Region' is NULL by selecting all non-null values.

Sum({$< Region={"*"} >} Sales)
Details →
Beginner Basic

Ignore Field

Ignores any selection on the 'Country' field (resets it to all values).

Sum({$< Country= >} Sales)
Details →
Intermediate Dynamic

Last 30 Days

Dynamic date filter relative to today.

Sum({$< OrderDate = {">=$(=Date(Today()-30))
Details →
Advanced Complex P()

Market Basket (A and B)

Customers who purchased both Product A AND Product B (intersection of P() sets).

Sum({$< Customer=P({1}) * P({1}) >} Sales)
Details →
Intermediate Aggregation Scope

Market Share (%)

Ratio of current selection to total (TOTAL). Ignores chart dimensions.

Sum(Sales) / Sum({1} Total Sales)
Details →
Intermediate Null Values

Only NULL Values

Explicitly selects records where 'Region' is empty / NULL.

Sum({$< Region-={"*"} >} Sales)
Details →
Advanced P() / E()

Possible Values P()

All countries that had sales in the 'North' region (Possible values function).

Sum({$< Country=P({1< Region={'Nord'} >} Country) >} Sales)
Details →
Intermediate Standard

Prior Year Comparison (PY)

Data for the same period as the current selection, but for the previous year (Last Year, LY).

Sum({< Year={$(=Max(Year)-1)} >} Sales)
Details →
Advanced Ranking

Revenue > 1000

Filters customers whose aggregated revenue in context exceeds 1000.

Sum({$< Customer={"=Sum(Sales)>1000"} >} Sales)
Details →
Intermediate Rolling

Rolling 12 Months

Sums sales for the last 12 months relative to today.

Sum({< OrderDate={">=$(=Date(AddMonths(Today(),-12)))
Details →
Intermediate Aggregation Scope

Share of Group

Share of revenue within a group (TOTAL ). Ignores other chart dimensions.

Sum(Sales) / Sum({$} Total Sales)
Details →
Advanced Ranking

Top 10 Customers

Filters based on a calculated ranking using element functions. Returns the top 10 by revenue.

Sum({$< Customer={"=Rank(Sum(Sales))
Details →
Intermediate Mengen

Union (+)

ODER Verknüpfung der Sets (Auswahl + 'USA').

Sum({$ + 1} Sales)
Details →
Intermediate Saved

Use Bookmark

Applies the selections stored in a saved bookmark.

Sum({MyBookmark} Sales)
Details →
Intermediate Advanced

Variable Usage

Uses a variable for dynamic filtering.

Sum({$< Year={$(=vMaxYear)} >} Sales)
Details →
Beginner Standard

Year-to-Date (YTD)

Summiert Daten vom Jahresanfang bis zum maximalen Datum.

Sum({< Year={$(=Max(Year))}, MonthNum={"
Details →

How to Use This Reference

Each card shows the expression name, a syntax snippet, and a difficulty badge. Click Details to see the full syntax, a working example with real field names, and links to related expressions.

Set Analysis Quick Syntax

The general form of a set analysis expression:

Sum( {<SetModifier>} FieldToAggregate )
  • {1}: Ignore all selections (full data set).
  • {$}: Current selections (default, same as no set modifier).
  • {<Year={2026}>}: Force Year to 2026, keep other selections.
  • {<Year=, Month=>}: Clear Year and Month selections, keep the rest.
  • {1<Year={2026}>}: Ignore all selections, then force Year to 2026.

Related Resources

Frequently Asked Questions

What is the difference between set analysis and an IF statement in Qlik?

Set analysis filters at the data model level before aggregation, which is significantly faster. An IF statement evaluates row by row during aggregation. For any expression that filters data, set analysis should be your default choice. Use IF only for conditional formatting or when you need to evaluate something that cannot be expressed as a set modifier.

Can I use variables inside set analysis?

Yes. Use dollar-sign expansion: Sum({<Year={$(vCurrentYear)}>} Sales). The variable is resolved before the expression is evaluated, so the set modifier receives the literal value.

How do I compare this year vs last year in one chart?

Create two measures. Current year: Sum({<Year={$(=Max(Year))}>} Sales). Previous year: Sum({<Year={$(=Max(Year)-1)}>} Sales). Both use set analysis to lock the year while respecting all other selections.