-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: V4.0_CSD03
-
Fix Version/s: V4.0_CSD04
-
Component/s: Data Aggregation
-
Labels:None
-
Environment:
Applied
-
Proposal:
Currently, nest can be used to create an entity with a single containment navigation property holding the result of a transformation sequence:
nest( cnp, t ) returns
[{ <cnp>: [ <result of t applied to input set> ] }]
There are use cases to generalize this and nest the results of multiple transformation sequences at once. Consider, for example, a request to combine the results of two transformations in a single response. Using transformation concat requires an extra computation of a concat index to relate an entity in the result to the corresponding concat argument (see ODATA-1138):
GET ~/Sales?$apply=concat(
filter(<complex expression 1>)
}}{{/groupby((Customer),aggregate(Amount with sum as Total))/compute(1 as concat_index),
filter(<complex expression 2>)
/groupby((Customer),aggregate(Amount with sum as Total))/compute(2 as concat_index))
If it makes sense to keep the results of the two transformations separately, they could be retrieved via an extended syntax of the transformation nest:
GET ~/Sales?$apply=nest(
filter(<complex expression 1>)
/groupby((Customer),aggregate(Amount with sum as Total)) as part_1,
filter(<complex expression 2>)
/groupby((Customer),aggregate(Amount with sum as Total)) as part_2)