Skip to content
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 23 additions & 17 deletions advanced/odata.md
Original file line number Diff line number Diff line change
Expand Up @@ -1091,21 +1091,25 @@ 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 | <X/> | <X/> |
| `search` | filter by search term or expression | <Na/> | <X/> |
| `groupby` | group by dimensions and aggregates values | <X/> | <X/> |
| `aggregate` | aggregate values | <X/> | <X/> |
| `compute` | add computed properties to the result set | <Na/> | <X/> |
| `expand` | expand navigation properties | <Na/> | <Na/> |
| `concat` | append additional aggregation to the result | <X/> | <X/> |
| `skip` / `top` | paginate | <X/> | <X/> |
| `orderby` | sort the input set | <X/> | <X/> |
| `topcount`/`bottomcount` | retain highest/lowest _n_ values | <Na/> | <Na/> |
| `toppercent`/`bottompercent` | retain highest/lowest _p_% values | <Na/> | <Na/> |
| `topsum`/`bottomsum` | retain _n_ values limited by sum | <Na/> | <Na/> |

| Transformation | Description | Node.js | Java |
|------------------------------|----------------------------------------------|:------------------:|:-----:|
| `filter` | filter by filter expression | <X/> | <X/> |
| `search` | filter by search term or expression | <Na/> | <X/> |
| `groupby` | group by dimensions and aggregates values | <X/> | <X/> |
| `aggregate` | aggregate values | <X/> | <X/> |
| `compute` | add computed properties to the result set | <Na/> | <X/> |
| `expand` | expand navigation properties | <Na/> | <Na/> |
| `concat` | append additional aggregation to the result | <X/> | <X/> |
| `skip` / `top` | paginate | <X/> | <X/> |
| `orderby` | sort the input set | <X/> | <X/> |
| `topcount`/`bottomcount` | retain highest/lowest _n_ values | <Na/> | <Na/> |
| `toppercent`/`bottompercent` | retain highest/lowest _p_% values | <Na/> | <Na/> |
| `topsum`/`bottomsum` | retain _n_ values limited by sum | <Na/> | <Na/> |
| `TopLevels` | retain only _n_ levels of a hierarchy | <X/><sup>2</sup> | <X/><sup>1,2</sup> |
| `ancestors/descendants` | retain ancestors/descendants of specific nodes | <X/> <sup>2</sup> | <X/><sup>1,2</sup> |

<sup>1</sup> - supported on SAP HANA, H2 ad PostgreSQL only
<sup>2</sup> - only to support requests from the UI5 Tree Table

#### `concat`

Expand Down Expand Up @@ -1137,7 +1141,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 |
Expand All @@ -1148,8 +1151,11 @@ This query groups the 500 most expensive books by author name and determines the
| `average` | average of values | <X/> | <X/> |
| `countdistinct` | count of distinct values | <X/> | <X/> |
| custom method | custom aggregation method | <Na/> | <Na/> |
| custom aggregate | predefined custom aggregate<sup>1</sup> | <X/> | <X/> |
| `$count` | number of instances in input set | <X/> | <X/> |

<sup>1</sup> 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.
Expand Down Expand Up @@ -1218,7 +1224,7 @@ A custom aggregate for a currency code or unit of measure should also be exposed
| chain transformations | <X/> | <X/> |
| chain transformations within group by | <Na/> | <Na/> |
| `groupby` with `rollup`/`$all` | <Na/> | <Na/> |
| `$expand` result set of `$apply` | <Na/> | <Na/> |
| `$expand` result set of `$apply` | <Na/> | <X/> |
| `$filter`/`$search` result set | <X/> | <X/> |
| sort result set with `$orderby` | <X/> | <X/> |
| paginate result set with `$top`/`$skip` | <X/> | <X/> |
Expand Down