Amazon QuickSight
User Guide

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

Order of Evaluation in Amazon QuickSight

When you open or update an analysis, before displaying it Amazon QuickSight evaluates everything that is configured in the analysis in a specific sequence. Amazon QuickSight translates the configuration into a query that a database engine can run. The query returns the data in a similar way whether you connect to a database, a SaaS source, or the Amazon QuickSight analytics engine (SPICE).

If you understand the order that the configuration is evaluated in, you know the sequence that dictates when a specific filter or calculation is applied to your data.

The following illustration shows the order of evaluation. The column on the left shows the order of evaluation when no level-aware aggregation is involved. The column in the middle shows the order of evaluation for analyses that contain calculated fields to compute at the prefilter level. The column on the right shows the order of evaluation for analyses that contain calculated fields to compute at the preaggregate level. Following the illustration, there is a more detailed explanation of the order of evaluation.

The following list shows the sequence in which Amazon QuickSight applies the configuration in your analysis. Anything that's set up in your data set happens outside your analysis, for example calculations at the data set level, filters, and security settings. These all apply to the underlying data. The following list only covers what happens inside the analysis.

  1. Prefilter level – Evaluates the data before analysis filters

    1. Simple calculations – Calculations without any aggregations.

    2. Level-aware aggregations: PRE_FILTER – With this setting, at this point Amazon QuickSight first evaluates prefilter calculations. It then applies any filters that are configured on these calculations.

  2. Preaggregate level – Evaluates the data set before aggregations

    1. Filters added during analysis – Filters created in the analysis apply to the data set for fields that aren't aggregated in the visuals, which are similar to WHERE clauses.

    2. Level-aware aggregations: PRE_AGG – With this setting, at this point Amazon QuickSight first performs preaggregate calculations before the aggregation is applied. It then applies any filters that are configured on these calculations.

    3. Top/bottom N filters – Filters that are configured on dimensions to display top/bottom N items.

  3. Display level – Evaluates aggregations, table calculations, and any remaining configurations applied in the visuals

    1. Display-level aggregations – With this setting, at this point Amazon QuickSight first performs aggregations based on the fields in the field wells. It then applies any filters that are configured on these fields, similar to HAVING clauses.

    2. Table calculations – With this setting, at this point Amazon QuickSight first performs window calculations on the display-level aggregations. It then applies any filters to the table calculations.

    3. Totals – Totals for measures as requested in tabular type visuals.