@@ -474,7 +474,7 @@ is executed. `POST /analytics/sql` refuses the same keys. To order by a member,
474474<Callout type = " info" >
475475** ` fields[] ` is the resolved presentation surface — read it first.** Each entry carries
476476` name ` and ` type ` and, when the producer declares them, ` label ` , ` format ` , ` currency ` ,
477- ` percentScale ` , ` builtinAggregate ` , ` aggregate ` , ` nullLabel ` and ` polarity ` (which direction
477+ ` currencyField ` , ` percentScale ` , ` builtinAggregate ` , ` aggregate ` , ` nullLabel ` and ` polarity ` (which direction
478478of a measure's change is good news, relayed from the dataset measure): the optional members
479479` AnalyticsResultResponseSchema ` declares (` packages/spec/src/api/analytics.zod.ts ` ),
480480mirrored member for member by ` IAnalyticsService.query ` 's ` AnalyticsResult ` and bound to
@@ -500,6 +500,13 @@ tenant default currency (the `localization.currency` setting), if one is set. A
500500so its column shows the tenant default. The cube query on this page carries no column
501501` currency ` .
502502
503+ A measure column over a ` currencyMode: 'record' ` amount has one currency per row, so it
504+ carries ` currencyField ` instead of ` currency ` : the name of the dimension column, in the same
505+ answer, that groups by the amount's code field (` currencyConfig.currencyField ` ). Each row's
506+ currency is that row's value of that column. A ` sum ` , ` avg ` , ` min ` or ` max ` over such an
507+ amount is refused ` INVALID_FIELD ` / 400 unless the query groups by the code field, on the
508+ dataset query and the cube query alike; a ` count ` is served.
509+
503510The dataset query also states each measure column's ` aggregate ` (` count ` , ` sum ` , ` avg ` ,
504511` min ` , ` max ` , ` count_distinct ` ), whether or not the author labelled the measure, so a
505512chart can tell a count from a sum. ` builtinAggregate ` is narrower: it is present only
0 commit comments