# Moving calculations upstream into Prep or databases

*Tableau Consultant Study Guide · Design and Troubleshoot Calculations and Workbooks · Last updated November 3, 2026 · https://www.certifyforce.com/study-guide/tableau-consultant/design-and-troubleshoot-calculations-and-workbooks/moving-calculations-upstream-into-prep-or-databases*

Decide which calculations belong in the database, a Tableau Prep flow or a materialized extract, and which must stay in the workbook: multi-grain LOD workarounds, cross-source and row-level logic, pre-aggregation for heavy table calculations, Compute Calculations Now and its exclusions, aggregate ratios, TODAY-based flags and static Prep ranks.

- Certification: Salesforce Tableau Consultant
- Exam section: Design and Troubleshoot Calculations and Workbooks
- Study guide: https://www.certifyforce.com/study-guide/tableau-consultant

**Official exam objective:**

> Recommend calculations that should be moved upstream of Tableau.

## What the exam expects

- Recommend moving granularity workarounds, cross-source calculations and shared row-level logic into the database or a Tableau Prep flow.
- Recommend pre-aggregating in the source when a table calculation receives a very large result set.
- Use Compute Calculations Now where it helps, and name the calculations it cannot materialize.
- Keep in the workbook what must respond to the view: aggregate ratios, TODAY-based logic and ranks that should follow viewer filters.

Key terms:
- **Upstream:** any layer before the workbook (the database, a Prep flow or the extract) where work is done before a user opens a view.
- **Materialized calculation:** a calculation whose values are computed in advance and stored in the extract.
- **Row-level expression:** a calculation evaluated in each row of the underlying table.
- **Aggregate calculation:** an expression over aggregated fields, computed at the view's level of detail.
- **Analytic function (Prep):** a RANK or ROW_NUMBER calculation over a partition of rows in a flow.

## Key facts

| Fact | Detail | Source |
|---|---|---|
| Upstream benefit | Processing done before the user requests the dashboard | [Workbook Optimizer](https://help.tableau.com/current/pro/desktop/en-us/wbo_overview.htm) |
| Multiple data sources | Tableau can't optimize; computes locally | [Workbook Optimizer](https://help.tableau.com/current/pro/desktop/en-us/wbo_overview.htm) |
| Prep FIXED syntax | `{FIXED [Field1],[Field2] : Aggregation([Field])}` | [Prep LOD, Rank, and Tile](https://help.tableau.com/current/prep/en-us/prep_calculations.htm) |
| Prep rank default | Descending; PARTITION optional, ORDERBY required | [Prep LOD, Rank, and Tile](https://help.tableau.com/current/prep/en-us/prep_calculations.htm) |
| When to materialize | Slow extract queries from complex calculations | [Materialize Calculations](https://help.tableau.com/current/pro/desktop/en-us/extracting_optimize.htm) |
| Materializing published extracts | Download, compute and republish, or tabcmd refreshextracts --addcalculations | [Materialize Calculations](https://help.tableau.com/current/pro/desktop/en-us/extracting_optimize.htm) |
| Extract size | Materializing calculations can increase it | [Materialize Calculations](https://help.tableau.com/current/pro/desktop/en-us/extracting_optimize.htm) |
| Aggregate calculation | `SUM(Sales) / SUM(Profit)` is computed at view level | [How LOD Expressions Work](https://help.tableau.com/current/pro/desktop/en-us/calculations_calculatedfields_lod_overview.htm) |
| Scheduled flows | Prep Conductor, with Data Management | [Get Started with Tableau Prep Builder](https://help.tableau.com/current/prep/en-us/prep_get_started.htm) |

## Check yourself

- Why can ROW_NUMBER in a Prep flow give different results on each run?
- When are calculations on column groups materializable?
- Which output targets can a Prep flow write to?
- Why might an index help a field you use often as a context filter?

## Sources

- [Workbook Optimizer](https://help.tableau.com/current/pro/desktop/en-us/wbo_overview.htm)
- [Create Efficient Calculations](https://help.tableau.com/current/pro/desktop/en-us/perf_efficient_calcs.htm)
- [Materialize Calculations in Your Extracts](https://help.tableau.com/current/pro/desktop/en-us/extracting_optimize.htm)
- [Create Level of Detail, Rank, and Tile Calculations](https://help.tableau.com/current/prep/en-us/prep_calculations.htm)
- [Get Started with Tableau Prep Builder](https://help.tableau.com/current/prep/en-us/prep_get_started.htm)
- [How Level of Detail Expressions Work in Tableau](https://help.tableau.com/current/pro/desktop/en-us/calculations_calculatedfields_lod_overview.htm)
- [Transform Values with Table Calculations](https://help.tableau.com/current/pro/desktop/en-us/calculations_tablecalculations.htm)
- [Know Your Data at the Database Level](https://help.tableau.com/current/pro/desktop/en-us/perf_data.htm)
- [Test Your Data and Use Extracts](https://help.tableau.com/current/pro/desktop/en-us/perf_extracts.htm)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 6 linked practice questions, and unlimited timed mock exams are included with the Tableau Consultant pack (USD $19): https://www.certifyforce.com/practice-exams
