150 likes | 435 Views
OData Extensions for Data Aggregation. Ralf Handl, SAP Siva Harinath , Microsoft Hubert Heijkers, IBM Gerald Krause, SAP Mike Pizzo , Microsoft July 26 th , 2012. Where do we want to go. GET ~/Sales. GET ~/Sales?$select=Product.
E N D
OData Extensions for Data Aggregation Ralf Handl, SAP Siva Harinath, Microsoft Hubert Heijkers, IBM Gerald Krause, SAP Mike Pizzo, Microsoft July 26th, 2012
GET ~/Sales?$select=Product,Amount &$aggregate=Amount
GET ~/Sales?$select=Product,Amount &$aggregate=Amount&$orderby=Amount desc
GET ~/Sales?$select=Product,Amount &$aggregate=Amount&$filter=Amount ge 8
GET ~/Sales?$select=Product,Revenue &$aggregate=Amount as Revenue&$filter=Amount ge 8
GET ~/Sales?$select=Product,Amount,MaxAmount &$aggregate=sum(Amount) ,max(Amount) as MaxAmount
GET ~/Sales?$select=Product,Amount &$aggregate=Amount ,count() as SalesCount
Measures <PropertyName="Amount"Type="Decimal"> <TypeAnnotationTerm="DataAggregation.DependentMeasure"> <PropertyValueProperty="DefaultAggregationFunction" String="sum"> <PropertyValueProperty="AcceptedAggregationFunctions"> <Collection> <String="sum"/> <String="max"/> </Collection> </PropertyValue> </TypeAnnotation> </Property>
Hierarchies <PropertyName="ProductGroup"Type="String"Nullable="false" /> <PropertyName="Product" Type="String"Nullable="false" /> <TypeAnnotationTerm="DataAggregation.LeveledHierarchy"> <PropertyValueProperty="Name"String="ProductHierarchy"/> <PropertyValueProperty="Levels"> <Collection> <String="ProductGroup"/> <String="Product"/> </Collection> </PropertyValue> </TypeAnnotation>
Open Topics • Links for „drillinginto“ aggregatedentities • More hierarchytypes: parent-child, ragged, … • Hierarchy-basedfunctions: descendants(), siblings() • Expressionsin $aggregate: sum(Revenue) - sum(Costs) asProfit • Split into $filter and $postfilter (WHERE/HAVING) • Merge$aggregateand $select, implicit $expand • Set functions for complex aggregations: ~/MySet/$Select(city,sales)/$Aggregate(sales)/$Select(sales)/$Aggregate() • References to annotations for units/currencies/texts