From 4a0841c1b31ce50fe7d1b38e1e40c6387c034313 Mon Sep 17 00:00:00 2001 From: Yauheni <70851093+Zhabrikoff@users.noreply.github.com> Date: Fri, 21 Aug 2026 07:46:21 +0300 Subject: [PATCH] docs: document bins and value groups in workbooks (#11605) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(mintlify): name the sidebar section that holds ad-hoc fields The page said new calculated fields land in a **Calculated fields** section of the field picker. The section is called **Query fields** — there is no section under the old name to look for, so a reader following the sentence finds nothing. Co-Authored-By: Claude Opus 5 * docs(mintlify): document bins and value groups in workbooks Both are query-scoped custom dimensions built from a dimension's own menu, so they belong on the calculated-fields page rather than on one of their own: same storage, same Query fields section, same delete action. What a reader cannot guess from the panel: the two open-ended edge buckets (so n boundaries give n + 1 buckets, and no row is dropped), the NULL and leftover labels, that equal-width ranges are resolved once at creation rather than tracked against the data, and the ordering prefix — labels sort lexically, so every bucket carries its position or '>= 25' sorts before '[0, 18)'. The screenshot is left as a TODO placeholder; the panel shot needs uploading to static.cube.dev first. Co-Authored-By: Claude Opus 5 * docs(mintlify): illustrate bins with the panel and a bucketed result Two shots, each earning its place rather than decorating the section: the panel before the prose that explains its fields, and a bucketed result right after the paragraph claiming the ordering prefix shows up in the grid — the claim is the kind a reader would otherwise have to take on trust. Both are hosted on the docs CDN; the repo takes no binaries. Co-Authored-By: Claude Opus 5 --------- Co-authored-by: Claude Opus 5 --- .../workbooks/calculated-fields.mdx | 64 ++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/docs-mintlify/docs/explore-analyze/workbooks/calculated-fields.mdx b/docs-mintlify/docs/explore-analyze/workbooks/calculated-fields.mdx index 14d3115f05620..c0ba31b89f080 100644 --- a/docs-mintlify/docs/explore-analyze/workbooks/calculated-fields.mdx +++ b/docs-mintlify/docs/explore-analyze/workbooks/calculated-fields.mdx @@ -30,7 +30,7 @@ metric or dimension for the analysis in front of you. ## Creating calculated fields in UI You can also build and edit calculated fields directly in the workbook. New -fields appear in the **Calculated fields** section of the field picker sidebar. +fields appear in the **Query fields** section of the field picker sidebar. ### Aggregations from existing dimensions @@ -83,6 +83,68 @@ The option appears only for **native** measures on pivoted columns, not for calculated fields. The same flow works in **Explore** when results are pivoted the same way. +### Bins and value groups + +You can also bucket an existing dimension without writing SQL. Open its menu in +the field picker sidebar and choose **Create bins…** on a number dimension, or +**Group values…** on a string one. Time dimensions have granularities instead, +and an already derived field cannot be bucketed again. + + + The Create bins panel on a number dimension, showing typed boundaries, the label styles, a preview of the five buckets, and the generated Semantic SQL + + +**Bins** take their boundaries either as a list (**Custom ranges**) or from a +**Start**, **Width**, and number of **Ranges** (**Equal width**). Each boundary +opens a bucket that includes its lower bound and excludes the upper one, and two +open-ended buckets are added at the edges—so `0, 18, 25` yields `< 0`, `[0, 18)`, +`[18, 25)`, `>= 25`, and no row is dropped. **Label style** renders a bucket as +`[10, 20)`, `>= 10 and < 20`, or `10 to 19`; the last is offered only while every +boundary is a whole number. Rows where the dimension is `NULL` are reported as +`Unknown`. + +**Value groups** collect the dimension's values into named sets: pick values, name +the group, and choose **Add group**. A value belongs to one group at a time. +Whatever you did not pick—including empty values—falls under **Everything else**, +which defaults to `Other`. + +Bucket labels carry their position as a prefix (`1.`, `2.`, zero-padded past nine +buckets) so that sorting the column sorts it by value rather than alphabetically, +which would put `>= 25` before `[0, 18)`. The prefix is visible in results, chart +legends, and axes. + + + A workbook result grouped by the bucketed field: one row per bucket, with the created field listed under Query fields in the sidebar + + +The panel previews the Semantic SQL it generates as you build: + +```sql +CASE WHEN orders_view.age IS NULL THEN 'Unknown' + WHEN orders_view.age < 0 THEN '1. < 0' + WHEN orders_view.age < 18 THEN '2. [0, 18)' + ELSE '3. >= 18' END +``` + + + +**Equal width** ranges are resolved into boundaries when the field is created, not +recomputed from the data. Values arriving later outside the range join the first +and last buckets instead of extending them. + + + +To change a bucketed field, choose **Edit bins…** or **Edit groups…** from its +menu—either in the sidebar or on its column header in the results. Only fields +this panel generated offer the action; a `CASE` expression written by hand does +not. + ### Editing a calculated field Select a calculated field in the sidebar to open the editor. You can change its