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
feat(analytics): propagate a measure's declared currency to the result field (#2102)
* feat(analytics): propagate a measure's declared currency to the result field
A dataset measure could declare a `format` (carried onto the analytics result
field so the client renders "$616,000"), but there was NO way to declare a
currency CODE. The analytics result enrichment set `label` + `format` on each
measure field but never `currency` — so the client's currency-aware formatting
(Intl symbol from a declared currency, ADR-0021; objectui DatasetWidget/report
renderer) could never fire against real data: every amount fell back to a plain
number or a "$" literal baked into `format`, regardless of the actual currency.
This adds the missing link, symmetric with `format`:
- spec: `DatasetMeasure.currency` (ISO 4217, optional) — declared on the
semantic layer when the aggregated field is a fixed-currency amount.
- service-analytics: carry `measure.currency` onto the result field alongside
`label`/`format`, so the renderer gets a real currency code.
- example (app-crm): `opportunity_metrics` total/avg amount now declare
`currency: 'USD'` (and drop the legacy `$` from `format`) so the pipeline
reports render a locale-correct symbol via Intl.
Tests: service-analytics 138 passed (+1: a measure's declared currency rides
onto its result field). Spec builds; the new field is additive + optional.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* chore: add changeset for dataset-measure currency
* chore(spec): classify dataset measures.currency in the liveness gate
---------
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
"note": "measure-declared currency (ISO 4217) enriched onto result fields alongside label/format, so the renderer formats the amount with a locale-correct Intl symbol rather than a '$' baked into format."
100
+
},
96
101
"certified": {
97
102
"status": "dead",
98
103
"evidence": "no runtime consumer — analytics execution never reads it; not compiled into the Cube",
0 commit comments