@@ -335,13 +335,28 @@ Execute an analytics query.
335335``` json
336336{
337337 "cube" : " account" ,
338- "measures" : [" revenue.sum " , " count" ],
338+ "measures" : [" revenue_sum " , " count" ],
339339 "dimensions" : [" industry" ],
340340 "where" : { "status" : " active" },
341341 "limit" : 100
342342}
343343```
344344
345+ <Callout type = " info" >
346+ ** How to spell a measure.** A ` measures ` entry is either a measure the Cube ** declares** ,
347+ or one of the inferred spellings: the bare ` count ` (` COUNT(*) ` ), or one of the object's
348+ ** own** field names plus an aggregation suffix — ` _sum ` , ` _avg ` , ` _min ` , ` _max ` ,
349+ ` _count_distinct ` . So "the sum of ` revenue ` " is ` revenue_sum ` .
350+
351+ A dot is legal ** only** as the ` <cube>. ` qualifier: ` account.revenue_sum ` resolves to the
352+ same measure as ` revenue_sum ` (the response column keeps whichever of the two you sent).
353+ Any other dotted spelling — ` revenue.sum ` , ` owner.amount_sum ` — is refused with
354+ ` 400 INVALID_FIELD ` naming the spelling you sent, and nothing is executed: measures do not
355+ traverse relationships, only dimensions do, so there is no related column for a dotted
356+ measure to aggregate. To aggregate a related column, declare a Cube whose measure names it
357+ in its own ` sql ` .
358+ </Callout >
359+
345360<Callout type = " info" >
346361Filtering uses the canonical Query DSL ` where ` object (the same MongoDB-style ` FilterCondition ` accepted by ` find() ` ), not a ` filters ` array.
347362</Callout >
@@ -352,12 +367,12 @@ Filtering uses the canonical Query DSL `where` object (the same MongoDB-style `F
352367 "success" : true ,
353368 "data" : {
354369 "rows" : [
355- { "industry" : " Technology" , "revenue.sum " : 150000 , "count" : 5 },
356- { "industry" : " Healthcare" , "revenue.sum " : 80000 , "count" : 3 }
370+ { "industry" : " Technology" , "revenue_sum " : 150000 , "count" : 5 },
371+ { "industry" : " Healthcare" , "revenue_sum " : 80000 , "count" : 3 }
357372 ],
358373 "fields" : [
359374 { "name" : " industry" , "type" : " string" , "label" : " Industry" },
360- { "name" : " revenue.sum " , "type" : " number" , "label" : " Revenue Sum" , "format" : " $0,0" },
375+ { "name" : " revenue_sum " , "type" : " number" , "label" : " Revenue Sum" , "format" : " $0,0" },
361376 { "name" : " count" , "type" : " number" , "label" : " Count" }
362377 ],
363378 "sql" : " SELECT ..."
0 commit comments