Download presentation
Presentation is loading. Please wait.
Published byLorena Horton Modified over 10 years ago
1
OData Extensions for Data Aggregation Ralf Handl, SAP Hubert Heijkers, IBM Gerald Krause, SAP Mike Pizzo, Microsoft Martin Zurmühl, SAP 20 August 2013
2
Where do we want to go Dimensions (4) Country Customer Category Product Country (2) Netherlands USA Category (2) Food Non-Food Measures (2) Amount (SUM) Amount (MAX) CountryCategoryAmount (SUM) NetherlandsFood2 Non-Food3 USAFood14 Non-Food5
3
Simple Composable Query Language $apply= transformation / transformation / … Transformations Subset topcount(…), topsum(…), …, bottompercent(…), filter(…), identity Reshape aggregate(…), expand(…) Fork & Merge groupby(…, sequence), concat(sequence, sequence, …) Custom Functions sequence
4
GET ~/Sales IDCategoryProductCountryCustomerAmount 1Non-FoodPaperUSAJoe1 2FoodSugarUSAJoe2 3FoodCoffeeUSAJoe4 4FoodCoffeeUSASue8 5Non-FoodPaperUSASue4 6FoodSugarNetherlandsSue2 7Non-FoodPaperNetherlandsSue1 8Non-FoodPaperNetherlandsSue2
5
GET ~/Sales?$apply=aggregate(Amount) Amount 24
6
GET ~/Sales?$apply=groupby((Product),aggregate(Amount)) ProductAmount Paper8 Sugar4 Coffee12
7
GET ~/Sales?$apply=groupby((Product),aggregate()) Product Paper Sugar Coffee
8
GET ~/Sales?$apply=groupby((Product)) Product Paper Sugar Coffee
9
GET ~/Sales?$apply=groupby((Product),aggregate(Amount)) &$orderby=Amount desc ProductAmount Coffee12 Paper8 Sugar4
10
GET ~/Sales?$apply=groupby((Product),aggregate(Amount)) &$filter=Amount ge 8 ProductAmount Coffee12 Paper8 ProductAmount Paper1 Sugar2 Coffee4 8 Paper4 Sugar2 Paper1 2
11
GET ~/Sales?$apply=filter(Amount ge 8) /groupby((Product),aggregate(Amount)) ProductAmount Coffee8 ProductAmount Paper1 Sugar2 Coffee4 8 Paper4 Sugar2 Paper1 2
12
GET ~/Sales?$apply=groupby((Product),aggregate(Amount, Amount with max as MaxAmount)) ProductAmountMaxAmount Coffee128 Paper84 Sugar42
13
GET ~/Sales?$apply=groupby((Product), aggregate($count as SalesCount)) ProductSalesCount Coffee2 Paper4 Sugar2
14
GET ~/Sales?$apply=groupby((rollup(Country,Customer), rollup(Category,Product)), aggregate(Amount)) Food Non- Food SugarCoffee Paper USA 1421255 Joe 62411 Sue 8 844 Nether- lands 22 33 Sue 22 33 CountryCustomerCategoryProductAmount USAJoeNon-FoodPaper1 USAJoeFoodSugar2 USAJoeFoodCoffee4 USASueFoodCoffee8 USASueNon-FoodPaper4 NetherlandsSueFoodSugar2 NetherlandsSueNon-FoodPaper3 USANULLFoodSugar2 USANULLFoodCoffee12 USANULLNon-FoodPaper5 NetherlandsNULLFoodSugar2 NetherlandsNULLNon-FoodPaper1 USAJoeFoodNULL6 USAJoeNon-FoodNULL1 USASueFoodNULL8 USASueNon-FoodNULL4 NetherlandsSueFoodNULL2 NetherlandsSueNon-FoodNULL3 USANULLFoodNULL14 USANULLNon-FoodNULL5 NetherlandsNULLFoodNULL2 NetherlandsNULLNon-FoodNULL3
15
ProductCountryAmount PaperUSA5 SugarUSA2 CoffeeUSA12 SugarNetherlands2 PaperNetherlands3 ProductCountryAmount CoffeeUSA12 PaperNetherlands3 GET ~/Sales?$apply=groupby((Product,Country),aggregate(Amount)) /groupby((Country),topcount(1,Amount))
16
ProductCountryAmount PaperUSA5 SugarUSA2 CoffeeUSA12 SugarNetherlands2 PaperNetherlands3 ProductCountryAmount CoffeeUSA12 USA7 PaperNetherlands3 2 GET ~/Sales?$apply=groupby((Product,Country),aggregate(Amount)) /groupby((Country),M.TopCountAndBalance(N=1,A='Amount'))
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.