Charles Olet (talk | contribs) mNo edit summary |
(Added Edited template with July 12, 2025.) |
||
(5 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
{{Edited|July|12|2025}} | |||
<message>Write the content here to display this box</message> | <message>Write the content here to display this box</message> | ||
Line 11: | Line 12: | ||
To get the product sales made on specific dates: | To get the product sales made on specific dates: | ||
[[File:ocl-groupby-expression | [[File:ocl-groupby-operator-expression.png|alt=Ocl groupby operator|frameless|878x878px]] | ||
'''NOTE:''' The groupBy expression always returns the grouping criteria object and a collection of matching objects grouped based on the criteria. | |||
'''NOTE:''' The groupBy expression always returns the grouping object and a collection of matching objects grouped based on the criteria. | |||
To get product sales made on specific dates with the quantity and sales amount: | To get product sales made on specific dates with the quantity and sales amount: | ||
[[File:groupby-ocl-expression.png|alt=groupby aggregation expression|frameless|865x865px]] | [[File:groupby-ocl-expression.png|alt=groupby aggregation expression|frameless|865x865px]] | ||
Tuples can be used to create more aggregations from our data which can then be accessed as parts of tuple. | Tuples can be used to create more aggregations from our data which can then be accessed as parts of the tuple. | ||
{| class="wikitable" | {| class="wikitable" | ||
|+ | |+ | ||
!Tuple Parts | !Tuple Parts | ||
(How to access the data) | |||
!Description | !Description | ||
|- | |- |
Latest revision as of 06:33, 20 January 2025
OCL groupBy expression groups together a collection of all matching objects based on a specified criteria, returning a tuple of the grouping criteria object and a collection of the matching objects in the List
property.
groupBy is well suited for aggregation with its ability to utilize tuples, enabling the creation of aggregate expressions for extraction of patterns from model-driven data that can be used for statistical analysis.
Example
To get the product sales made on specific dates:
NOTE: The groupBy expression always returns the grouping criteria object and a collection of matching objects grouped based on the criteria.
To get product sales made on specific dates with the quantity and sales amount:
Tuples can be used to create more aggregations from our data which can then be accessed as parts of the tuple.
Tuple Parts
(How to access the data) |
Description |
---|---|
Part1 | The grouping criteria object accessed with grouping object name .DateAdded instead of .Part1 since it is known and available in groupBy result.
|
Part2 | The total quantity sold accessed as .Part2 since it is computed and not available in the groupBy result.
|
Part3 | The total sales amount accessed as .Part3 since it is also computed and not available in the groupBy result.
|