-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: V4.0_CS01
-
Fix Version/s: V4.0_CSD03
-
Component/s: Data Aggregation
-
Labels:None
-
Environment:
[Applied]
-
Proposal:
-
Resolution:
We haven't specified the usage of $apply as "Expand Option" in $expand.
There are good use cases for $apply as an option of $expand (and it combines very well):
GET Products?$expand=Sales($apply=aggregate(Amount with sum as Total))
Returns all products, and the Sales navigation property value is a one-element array with the Total
Means: per Product in top-level result inline result of
GET Product(<key>)/Sales?$apply=aggregate(Amount with sum as Total)
This is equivalent to the clumsier
GET Products?$apply=groupby((<key properties of Product>,<all non-key structural properties of Product>),aggregate(Sales/(Amount with sum as Total))