analystUpdated 2026-04-17

Query Returns Wrong Results

Model Health tab — warning + error rows that explain wrong query results.

What this covers

Diagnosing incorrect values returned by Tessallite queries. If values are wrong, the cause is almost always in the model definition, data freshness, or the underlying source data — not in the routing layer.

Step 1 — Check the measure definition

Open Model Builder and navigate to the measure returning unexpected values.

Step 2 — Check for grain mismatch

If a query asks for totals and an aggregate exists at a finer grain, Tessallite re-aggregates the pre-built summary. This is correct for additive measures but produces wrong results for COUNT DISTINCT.

If the query uses COUNT DISTINCT and returns a value that is too high, no exact-grain aggregate exists for that query pattern. Ask your Modeller to build an aggregate at the exact grain required, or reformulate the query to match an existing aggregate grain.

Step 3 — Check for stale data

In Model Builder, check the status column for each aggregate:

StatusMeaning
ReadyAggregate is current
StaleSource has changed since last build — run a refresh
BuildingRefresh in progress — wait for completion
ErrorLast build failed — see Aggregates Not Building

Step 4 — Check for schema drift

  1. Open Model Builder.
  2. Select the project.
  3. Go to the Health tab.
  4. Look for "Schema drift detected" warnings.
  5. Update the model to reference the correct column, re-publish, and rebuild aggregates.

Step 5 — Compare with a direct query

Run the equivalent query directly against the source database (bypassing Tessallite). If the direct query also returns wrong values, the problem is in the source data. If the direct query returns correct values, return to Steps 1–4.

Related