How queries work
What happens between dropping a field and seeing a number.
One pass per fact
Suppose a table has Month, Net sales and Refund amount. Sales and returns are different fact tables with different numbers of rows. Joining them would repeat each sale once per return and inflate both totals.
QuackUI aggregates each fact by month on its own, joining only to the dimensions it needs, then merges the results on month. A month with returns and no sales still appears.
Totals come from rows
Totals are separate queries at a coarser level. They never add up the cells above them. This matters for averages, distinct counts, stock and ratios. A customer who bought in three months counts once in the year.
Filters
Filters on dimensions apply before aggregation, in every pass. Filters on measures apply to the merged result, so Sold is at least 50 means the total for that row.
Is not and is not one of keep empty values. Other comparisons drop them. Values are always bound as parameters.
Fields that don’t go together
If a dimension can’t be reached from a measure’s fact table, the block says so and names both. QuackUI doesn’t cross-join to make it work.
The sandbox
Each query runs in a private in-memory DuckDB with the model’s source files open read-only, no other file readable, and extension loading and spilling to disk off. Only a single SELECT can run. By default it gets 60 seconds, 1 GB of memory and 2 threads, four run at once and 32 can wait.
Results stop at 100,000 rows or 50 MB, and a cut result says it is cut.
Caching
Results are cached in Postgres for an hour. The key includes the model version, the query, your row and column access, the resolved dates, and the size and modification time of each file and of any DuckDB write-ahead log (.wal) beside it. Change a file and its cached results stop being used. Refresh Data skips the cache.
Read the SQL
Every run keeps its SQL.

