Solving Business Solving Business Problems In OLAP Problems In OLAP Services Using MDX – Services Using MDX – Part I Part I Amir Netz – Dev Manager & Amir Netz – Dev Manager & Architect Architect Ariel Netz – Program Manager Ariel Netz – Program Manager SQL Server OLAP Services SQL Server OLAP Services Microsoft Corporation Microsoft Corporation 5-304 5-304 Global Breakout Session Hardware Provider Global Breakout Session Hardware Provider
48
Embed
Solving Business Problems In OLAP Services Using MDX – Part I Amir Netz – Dev Manager & Architect Ariel Netz – Program Manager SQL Server OLAP Services.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Solving Business Problems Solving Business Problems In OLAP Services Using In OLAP Services Using MDX – Part IMDX – Part I
Amir Netz – Dev Manager & ArchitectAmir Netz – Dev Manager & ArchitectAriel Netz – Program ManagerAriel Netz – Program ManagerSQL Server OLAP ServicesSQL Server OLAP ServicesMicrosoft CorporationMicrosoft Corporation
What is MDX?What is MDX? MDX BasicsMDX Basics MDX QueriesMDX Queries Solving Business Problems with MDXSolving Business Problems with MDX
Functionality Functionality
KnowledgeKnowledge RequiredRequired
Knowing MDXKnowing MDX
What Is MDXWhat Is MDX
MDX = Multi Dimensional ExpressionsMDX = Multi Dimensional Expressions A syntax for modeling and querying A syntax for modeling and querying
an OLAP databasean OLAP database Part of the OLE DB for OLAP SpecPart of the OLE DB for OLAP Spec Supported by multiple providers Supported by multiple providers
SELECT sets on axes (N axes)SELECT sets on axes (N axes) FROM a source cubeFROM a source cube WHERE the data is sliced by some WHERE the data is sliced by some
coordinatescoordinates
Sample CubeSample Cube
Dimensions:Dimensions: MeasuresMeasures: Sales, Cost, Units: Sales, Cost, Units Time:Time: Year, Quarter, Month Year, Quarter, Month GeographyGeography: All, Region, Country: All, Region, Country ProductsProducts: All, Product Group, Product : All, Product Group, Product
NameName CustomersCustomers: All, Customer Group, : All, Customer Group,
Customer NameCustomer Name
SelectSelect Time.year.members on Time.year.members on RowsRows,,Measures.members on Measures.members on ColumnsColumns,,Product.[Product Department].members Product.[Product Department].members
Every Cell Still Has A Name...Every Cell Still Has A Name...
Calculated MembersCalculated Members
Calculated members are the real Calculated members are the real power behind OLAPpower behind OLAP
They provide the mean to define They provide the mean to define complex business logiccomplex business logic
MDX is the syntax for calculated MDX is the syntax for calculated membersmembers Statements – tools, query generators, Statements – tools, query generators,
developersdevelopers Calculated members – DBAs and Calculated members – DBAs and
power userspower users
9797
9898
9999
GroceriesGroceries
ClothingClothingAppliancesAppliances
SalesSalesCostCost UnitsUnits
9696
9595
With With member Measures.Growthmember Measures.Growth as as ‘(‘(Time.currentmemberTime.currentmember,Measures.Sales)- ,Measures.Sales)- ((Time.currentmember.prevmemberTime.currentmember.prevmember,Measures.Sales)’,Measures.Sales)’
SelectSelect Time.year.members on Time.year.members on RowsRows,,AddCalculatedMembers(Measures.members) on AddCalculatedMembers(Measures.members) on ColumnsColumns,,Product.[Product Department].members on PagesProduct.[Product Department].members on PagesFromFrom Sales Sales
How Did Sales In This Period How Did Sales In This Period Compare With Sales In The Compare With Sales In The Previous Period?Previous Period?
Year Quarter Month Sales ResultTotal 97Total Q1 120Jan 30Feb 40
Q1
Mar 50
Total Q4 285Oct 80Nov 100
1997
Q4
Dec 105Total 98Total Q1 170Jan 50Feb 55
Q1
Mar 65
Total Q4 275Oct 90Nov 100
1998
Q4
Dec 85
20
10
50
-10
Sales
How Did Sales In The Current How Did Sales In The Current Period Compare With The Period Compare With The Same Period In The Previous Same Period In The Previous Year?Year?
Year Quarter Month Sales ResultTotal 97Total Q1 120Jan 30Feb 40
How Did Sales In The Current Period How Did Sales In The Current Period Compare With The Same Period In Compare With The Same Period In the Previous Year?the Previous Year?
Year Quarter Month Sales Result790120 120
Jan 30 30Feb 40 70
Q1
Mar 50 120200 320
April 65 185May 45 230
Q2
Jun 90 320185 505
Jul 55 375Aug 60 435
Q3
Sep 70 505285 790
Oct 80 585Nov 100 685
1997
Q4
Dec 105 790
What Is My Total Since The What Is My Total Since The Beginning Of The Year?Beginning Of The Year?