diff --git a/advanced/odata.md b/advanced/odata.md index 64cfdc862..e221ead85 100644 --- a/advanced/odata.md +++ b/advanced/odata.md @@ -1052,21 +1052,24 @@ If the `groupby` transformation only includes a subset of the entity keys, the r ### Transformations -| Transformation | Description | Node.js | Java | -|------------------------------|---------------------------------------------|:------------------:|:-----:| -| `filter` | filter by filter expression | | | -| `search` | filter by search term or expression | | | -| `groupby` | group by dimensions and aggregates values | | | -| `aggregate` | aggregate values | | | -| `compute` | add computed properties to the result set | | | -| `expand` | expand navigation properties | | | -| `concat` | append additional aggregation to the result | | | -| `skip` / `top` | paginate | | | -| `orderby` | sort the input set | | | -| `topcount`/`bottomcount` | retain highest/lowest _n_ values | | | -| `toppercent`/`bottompercent` | retain highest/lowest _p_% values | | | -| `topsum`/`bottomsum` | retain _n_ values limited by sum | | | - +| Transformation | Description | Node.js | Java | +|------------------------------|----------------------------------------------|:------------------:|:-----:| +| `filter` | filter by filter expression | | | +| `search` | filter by search term or expression | | | +| `groupby` | group by dimensions and aggregates values | | | +| `aggregate` | aggregate values | | | +| `compute` | add computed properties to the result set | | | +| `expand` | expand navigation properties | | | +| `concat` | append additional aggregation to the result | | | +| `skip` / `top` | paginate | | | +| `orderby` | sort the input set | | | +| `topcount`/`bottomcount` | retain highest/lowest _n_ values | | | +| `toppercent`/`bottompercent` | retain highest/lowest _p_% values | | | +| `topsum`/`bottomsum` | retain _n_ values limited by sum | | | +| `TopLevels` | retain only _n_ levels of a hierarchy | | 1 | +| `ancestors/descendants` | retain ancestors/descendants of specific nodes | | 1 | + +1 - supported on SAP HANA, H2 ad PostgreSQL only #### `concat` @@ -1098,7 +1101,6 @@ GET /Order(10)/books? This query groups the 500 most expensive books by author name and determines the price of the most expensive book per author. - ### Aggregation Methods | Aggregation Method | Description | Node.js | Java | @@ -1109,8 +1111,11 @@ This query groups the 500 most expensive books by author name and determines the | `average` | average of values | | | | `countdistinct` | count of distinct values | | | | custom method | custom aggregation method | | | +| custom aggregate | predefined custom aggregate1 | | | | `$count` | number of instances in input set | | | +1 CAP Node.js does not support custom aggregates for currencies or units of measure. + ### Custom Aggregates Instead of explicitly using an expression with an aggregation method in the `aggregate` transformation, the client can use a _custom aggregate_. A custom aggregate can be considered as a virtual property that aggregates the input set. It's calculated on the server side. The client doesn't know _How_ the custom aggregate is calculated. @@ -1145,7 +1150,7 @@ which is equivalent to: GET /Books?$apply=aggregate(stock with sum as stock) HTTP/1.1 ``` -#### Currencies and Units of Measure +#### Currencies and Units of Measure {.java} 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. @@ -1179,7 +1184,7 @@ A custom aggregate for a currency code or unit of measure should also be exposed | chain transformations | | | | chain transformations within group by | | | | `groupby` with `rollup`/`$all` | | | -| `$expand` result set of `$apply` | | | +| `$expand` result set of `$apply` | | | | `$filter`/`$search` result set | | | | sort result set with `$orderby` | | | | paginate result set with `$top`/`$skip` | | |