Skip to content

Commit 92a2334

Browse files
committed
no-mistakes(document): Document no-@Of any/all in reporting and Cube docs
1 parent 17d000e commit 92a2334

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎docs/features/cube-export.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ somewhere to go: an `identity.reference` onto an entity that is not a cube makes
322322
| `count` with `@distinct` | `type: count_distinct`, `sql: x` |
323323
| `count` with `@distinct` over a tuple `x1, x2` | Postgres: `type: count_distinct`, `sql: 'ROW(x1, x2)'`, with one `filters` entry `x1 IS NOT NULL AND x2 IS NOT NULL`, so a tuple with a null component is not counted, as in the view. MySQL: the view's own `COUNT(DISTINCT x1, x2)` as a `type: number` measure (a condition `c` makes it `COUNT(DISTINCT CASE WHEN c THEN x1 END, x2)`); MySQL's multi-argument form skips a tuple with a null component and compares by the columns' collation, which a `JSON_ARRAY(x1, x2)` key does not: on mysql:8.4 under the default `utf8mb4_0900_ai_ci` it counted `'abc'` and `'ABC'` as two tuples where the view counts one |
324324
| `sum`, `avg`, `min`, `max` | `type: sum`, `avg`, `min`, `max`, `sql: x` |
325-
| `any`, `all` | `type: boolean`. Postgres: `sql: 'bool_or(x)'` / `'bool_and(x)'`, a condition `c` as `bool_or(x) FILTER (WHERE c)`. MySQL: `sql: 'MAX(x)'` / `'MIN(x)'`, a condition as `MAX(CASE WHEN c THEN x END)`. The aggregate is the view's own, written in `sql` because Postgres has no `MAX(boolean)` and the condition cannot ride in `filters`. |
325+
| `any`, `all` | `type: boolean`. Postgres: `sql: 'bool_or(x)'` / `'bool_and(x)'`, a condition `c` as `bool_or(x) FILTER (WHERE c)`. MySQL: `sql: 'MAX(x)'` / `'MIN(x)'`, a condition as `MAX(CASE WHEN c THEN x END)`. The aggregate is the view's own, written in `sql` because Postgres has no `MAX(boolean)` and the condition cannot ride in `filters`. With no `@of`, the condition is the aggregated value: `bool_or(c)` / `bool_and(c)`, `MAX(c)` / `MIN(c)` on MySQL. |
326326
| any of the above with a condition `c` | the same, with one `filters` entry `c`. For a Postgres tuple, `c` is ANDed after the not-null terms in that one entry. |
327327
| `measure.ratio` | `type: number`. Postgres: `CAST({num} AS NUMERIC) / NULLIF({den}, 0)`. MySQL: `{num} / NULLIF({den}, 0)`. |
328328
| 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`. |

‎docs/features/reporting.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ FR-037 R5's arithmetic wave and will need its own agreement):
5454
|---|---|---|
5555
| `dimension.attribute` | `object.entity` | `@of` (required), `@via` |
5656
| `dimension.time` | `object.entity` | `@of` (required), `@via`, `@grains` (required, array) |
57-
| `measure.aggregate` | `object.entity` | `@agg` (required), `@of` (required, array), `@distinct`, `@filter`, `@segment`, `@default` |
57+
| `measure.aggregate` | `object.entity` | `@agg` (required), `@of` (required, array, except `any` / `all`), `@distinct`, `@filter`, `@segment`, `@default` |
5858
| `measure.ratio` | `object.entity` | `@numerator` (required), `@denominator` (required), `@default` |
5959
| `segment.filter` | `object.entity` | `@filter` (required) |
6060
| `object.report` | root | `@from` (required), `@dimensions` (array), `@measures` (required, array), `@segment`, `@filter`, `@spine` |

0 commit comments

Comments
 (0)