You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 56653ca
Browse filesBrowse the repository at this point in the historyBrowse files
| a `measure.aggregate` with `@default: n` | two members. `<m>Raw` is the aggregate as the rows above write it (its `type`, `sql` and `filters`), with `public: false`. `<m>` is `type: number` (`type: boolean` for an `any` or `all`, where `n` is written `TRUE` / `FALSE` on Postgres and `1` / `0` on MySQL), `sql: 'COALESCE({<m>Raw}, n)'`, and carries the measure's `title` and `description`. |
329
329
| a `measure.ratio` with `@default: n` | `type: number`, the quotient above inside `COALESCE(…, n)` |
330
+
| `measure.derived` | `type: number`, `sql` the `@expr` over the operand measures' members (each operand is its full Cube expression, as in a ratio). `divide` is `CAST(x AS NUMERIC) / NULLIF(y, 0)` on Postgres and `x / NULLIF(y, 0)` on MySQL. A `@expr` that reads a dimension (not a measure) is `ERR_CUBE_DERIVED_DIMENSION`. |
330
331
331
332
In a ratio, `{num}` and `{den}` are references to the two operand measures, so each operand is
332
333
its full Cube expression, condition included, and an operand need not be listed in any report.
@@ -491,6 +492,8 @@ are printed in its messages and are not loader codes.
491
492
| `ERR_CUBE_NAME_COLLISION` | two cubes, or a cube and a view, would have one name |
492
493
| `ERR_CUBE_UNESCAPABLE_LITERAL` | a literal, an identifier or free text that is raw-wrapped (it holds a Jinja opener) holds `endraw` |
493
494
| `ERR_CUBE_UNSUPPORTED_DIALECT` | the dialect is neither `postgres` nor `mysql` and the run would write a cube |
495
+
| `ERR_CUBE_VALUE_OBJECT_MEMBER` | an `@of` names a value-object member (`Entity.field.member`); the exporter does not map it |
496
+
| `ERR_CUBE_DERIVED_DIMENSION` | a `measure.derived` `@expr` reads a dimension rather than a measure |
494
497
495
498
## Which files a run writes
496
499
@@ -676,7 +679,8 @@ jobs API) before a query can use them.
676
679
- **No `sqlite` or `d1`.** See [Dialects](#wiring-it).
677
680
- **No `extends`, no `refresh_key`, no partitions, no `format`.** The exporter writes cubes, and
678
681
a Cube view only for a served `@spine` report.
679
-
- **No derived measure.** `measure.derived` is not registered, so there is nothing to map.
682
+
- **No member of a value object.** An `@of` naming `Entity.field.member` is `ERR_CUBE_VALUE_OBJECT_MEMBER`
683
+
(see [What the exporter refuses](#what-the-exporter-refuses)). Read it through a report view instead.
0 commit comments