From 157be03fb58c82423206f57dbddbabd14fea5abd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Heiko=20Thei=C3=9Fen?= Date: Tue, 18 Feb 2025 14:32:34 +0100 Subject: [PATCH] Aggregation.default mandatory for custom aggregate --- advanced/odata.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/advanced/odata.md b/advanced/odata.md index 13f1ad0ec..f8a2e8f74 100644 --- a/advanced/odata.md +++ b/advanced/odata.md @@ -1187,6 +1187,7 @@ GET /Books?$apply=aggregate(stock with sum as stock) HTTP/1.1 #### Currencies and Units of Measure If a property represents a monetary amount, it may have a related property that indicates the amount's *currency code*. Analogously, a property representing a measured quantity can be related to a *unit of measure*. To indicate that a property is a currency code or a unit of measure it can be annotated with the [Semantics Annotations](https://help.sap.com/docs/SAP_NETWEAVER_750/cc0c305d2fab47bd808adcad3ca7ee9d/fbcd3a59a94148f6adad80b9c97304ff.html) `@Semantics.currencyCode` or `@Semantics.unitOfMeasure`. +The aggregation method (typically, sum) is specified with the `@Aggregation.default` annotation. ```cds @Aggregation.CustomAggregate#amount : 'Edm.Decimal' @@ -1195,6 +1196,7 @@ entity Sales { key id : GUID; productId : GUID; @Semantics.amount.currencyCode: 'currency' + @Aggregation.default: #SUM amount : Decimal(10,2); @Semantics.currencyCode currency : String(3);