Now accepting guest editorial from SAP, Oracle, Workday and ServiceNow practitioners.Pitch a guide
The Sign-Off Table

Lesson 5 of 6

Query regression testing and reconciliation

10 min

Listen to this lesson

0:00 / 7:05

Every BW path ends with one question from Dan: "Does my margin report still show the same numbers?" Query regression testing answers it with evidence. This lesson shows how to select queries, fix their inputs, compare results cell by cell, and handle the features that most often differ.

Selecting the regression set

  • Critical: queries used in period close, statutory or management reporting (the monthly margin by customer, the management pack).
  • Heavily used: the top queries by executions and users from BW statistics.
  • Risky: queries on providers with routines, currency conversion, hierarchies, exception aggregation, conditions or non-cumulative key figures.
  • Representative: at least one query per InfoProvider in scope, so every provider is touched.

Contoso's set for the lift has 120 queries out of the roughly 840 that remain after cleanup (illustrative): 35 critical, 50 heavy, 25 risky and 10 representative. Each has a test variant: fixed variable values (company code 1710, fiscal period 09/2026, ledger 0L, currency USD), a fixed navigation state (drilldown by customer and month), and the expected data date.

Running the comparison

  1. Freeze the data: run the baseline on a closed period after the last load, or on a copy, so source data cannot change between runs.
  2. Baseline: execute each query with its variant before the change (for example with RSRT or Analysis for Office) and export the full result, including totals.
  3. Change: perform the lift, conversion or rebuild.
  4. Rerun: execute the same variant on the target (BW PCE query, BW/4HANA query, or the new Datasphere analytic model or SAC story) and export.
  5. Compare cell by cell on the characteristics and key figures, not just grand totals. Zero tolerance for amounts and quantities in document or local currency.
  6. Classify differences: expected (documented design change), defect, or test artifact (wrong variant, different data date).
Query regression: same query, same variant, before and after, compared cell by cell.
The Sign-Off Table · thesignofftable.com/academy/sap-dap-302

Features that most often differ

FeatureWhy it differs after a changeHow to test
Currency conversionDifferent rate type, date or translation step in the targetCompare in source currency first, then translated, for a period with rate changes
Exception aggregationTarget model aggregates in a different orderHand-calculate three customers; compare at each drill level
HierarchiesDifferent hierarchy version, date or unassigned nodesCompare node totals and the unassigned node
Non-cumulative key figures (stock)Snapshot logic rebuilt differentlyCompare stock at several key dates, including period ends
Restricted and calculated key figuresFilter or formula translated slightly differentlyOne known case per key figure
RoutinesLogic not carried over in a rebuildKnown cases that exercise each routine rule

Where query results most often change after a move, and how to catch it.

A regression cycle around a lift rehearsal. The same cycle repeats for the production lift weekend with a reduced critical set.
The Sign-Off Table · thesignofftable.com/academy/sap-dap-302
  1. Check the runSame variant, same data date, same user role on both sides?
  2. Locate the cellWhich characteristic values and key figures differ?
  3. Check the featureCurrency, hierarchy, exception aggregation, non-cumulative, restricted key figure, routine?
  4. Find the layerData (load or product), model (logic) or presentation (query or story)?
  5. ClassifyExpected design change, defect, or test artifact
Triage for a query regression difference, from the cheapest explanation to the deepest.
The Sign-Off Table · thesignofftable.com/academy/sap-dap-302

With 120 queries and several cycles, comparison must be automated. Export each baseline and target result in a structured form (characteristic keys plus key figures), store them with the run ID and variant, and compare them by key with a script or a comparison view in Datasphere. The comparison produces a list of differing cells, not a yes or no. Manual comparison of exported spreadsheets is where most regression projects lose time and accuracy, especially for queries with hundreds of customers and twelve months.

What would you do?

After the rebuild of the margin report in Datasphere, totals match for September, but the Chicago (plant 1720) customers show 156.00 standard cost in BW and 150.00 in Datasphere. What happened?

Regression for a rebuild has one extra difficulty: the target is not the same query. A Datasphere analytic model and an SAC story may present data at a different granularity, use different names, or deliberately change a definition. Before comparing, Priya writes a mapping per query: which BW characteristic maps to which dimension, which key figure to which measure, and which differences are intended (for example a new revenue definition that excludes freight). Only unmapped or unintended differences are defects; intended ones need Dan’s explicit approval as a design change.

Key points
  • Select critical, heavily used, risky and representative queries; give each a stored test variant.
  • Freeze the data, take a baseline, change, rerun, compare cell by cell.
  • Watch currency, exception aggregation, hierarchies, non-cumulatives, restricted key figures and routines.
  • Classify each difference as expected, defect or test artifact; zero unexplained amount differences.

Check your understanding · not graded

Lesson check

  1. 1. Why compare query results cell by cell instead of only grand totals?

  2. 2. What does a stored test variant fix?

  3. 3. How should stock (non-cumulative) key figures be regression-tested?

  4. 4. What causes many false differences in query regression?