Presentation is loading. Please wait.

Presentation is loading. Please wait.

Atlanta.MDF MDX Overview. What Is MDX? MDX is Multi Dimensional EXpressions MDX is the syntax for querying an Analysis Services database MDX is part of.

Similar presentations


Presentation on theme: "Atlanta.MDF MDX Overview. What Is MDX? MDX is Multi Dimensional EXpressions MDX is the syntax for querying an Analysis Services database MDX is part of."— Presentation transcript:

1 Atlanta.MDF MDX Overview

2 What Is MDX? MDX is Multi Dimensional EXpressions MDX is the syntax for querying an Analysis Services database MDX is part of the OLE DB for OLAP spec MDX is the key for all advanced analytical capabilities of Analysis Services

3 Comparison To SQL SQL ConstructOLAP construct SELECT…SELECT… (MDX) CREATE…DSO object model DROP… INSERT… DELETE…

4 MDX Basics MDX allows easy navigation in the multi dimensional space It “understands” the MD concepts of cube, dimension, level, member and cell It is used for –Queries – full statements (SELECT…FROM) –Business modeling – defining calculated members using MDX Expressions – not a full statement

5 MDX Queries vs. MDX Expressions MDX Queries –Full statements (SELECT…FROM) –Usually generated by a query tools and applications such as Excel –MDX Sample App deals in queries MDX Expressions –Partial MDX statements –Define a calculated member, or a set, or member properties, etc. –Returns a single value (which may be a set)

6 MDX Myth Fact: MDX is used everywhere: Calculated members Calculated members Security settings Security settings Custom member rollup Custom member rollup Custom level rollup Custom level rollup Actions Actions Define named “Sets” Define named “Sets” Calculated cells Calculated cells “Only developers need to know MDX”

7 MDX Constructs Members: an item in a hierarchy –[John Doe] –[2001] –[2001].[Q1].[Jan] Tuple: an intersection of 2 or more members –([Product].[Drink].[Beverages], [Customers].[USA]) –([Product].[Non-Consumable], [2001]) Sets: a group of tuples or members –{[John Doe], [Jane Doe]} –{ ( [Non-Consumable], USA ), ( Beverages, Mexico ) } –[2001].Children –TopCount(Store.[Store Name]. Members, 10, Sales)

8 Groceries Clothing Appliances Sales Cost Units Every Cell Has A Name Measures Time Products

9 Groceries Clothing Appliances Sales Cost Units (Products.Clothing, Measures.Units, Time.[2000]) Every Cell Has A Name Measures Time Products

10 Groceries Clothing Appliances Sales Cost Units (Products.Clothing, Measures.Units, Time.[2000]) (Products.Clothing, Measures.Sales, Time.[1999]) Every Cell Has A Name Measures Time Products

11 Groceries Clothing Appliances Sales Cost Units (Products.Clothing, Measures.Units, Time.[2000]) (Products.Clothing, Measures.Sales, Time.[1999]) (Products.Groceries, Measures.Cost, Time.Year.[1997]) Every Cell Has A Name Measures Time Products

12 Groceries Clothing Appliances SalesCostUnits (Products.Clothing, Measures.Units, Time.[2000]) = (Products.CurrentMember, Measures.CurrentMember, Time.CurrentMember) The Current Cell: Currentmember

13 2000 Clothing Sales ? Naming Cells With Relative References...

14 2000 Clothing Sales ? ? (Products.Clothing, Measures.Sales, Time.[2000].PrevMember)

15 2000 Clothing Sales ? ? ? Naming Cells With Relative References... (Products.Clothing, Measures.Sales, Time.[2000].PrevMember) (Products.Clothing, Measures.Sales, Time.[2000].NextMember)

16 (Products.Clothing, Measures.Sales.PrevMember, Time.[2000].Lag(3)) 2000 Clothing Sales ? ? ? Naming Cells With Relative References... (Products.Clothing, Measures.Sales, Time.[2000].PrevMember) (Products.Clothing, Measures.Sales, Time.[2000].NextMember) OR(Products.Clothing,Measures.Sales.PrevMember, Time.[2000].Lead(-3))

17 Calculated Members Calculated members add significant power to Analysis cubes Pre-define complex business logic Pre-define complex business logic Usually create calculated measures Usually create calculated measures Computed at run- time Computed at run- time

18 1. How Did Sales This Period Compare With Sales In The Previous Period? YearQtrMonSales Q1120 Jan30 Feb40 Mar50 Q2200 Apr65 May45 Jun90 Q3185 Jul55 Aug60 Sep70 Q4285 Oct80 Nov100 Dec105

19 QtrMonSalesDelta Q Apr6515 May45-20 Jun How Did Sales This Period Compare With Sales In The Previous Period? (Time.CurrentMember, Measures.CurrentMember) =

20 QtrMonSalesDelta Q Apr6515 May45-20 Jun How Did Sales This Period Compare With Sales In The Previous Period? (Time.CurrentMember, Measures.CurrentMember) = (Time.CurrentMember, Measures.Sales) -

21 QtrMonSalesDelta Q Apr6515 May45-20 Jun9045 (Time.CurrentMember.PrevMember, Measures.Sales) 1. How Did Sales This Period Compare With Sales In The Previous Period? (Time.CurrentMember, Measures.CurrentMember) = (Time.CurrentMember, Measures.Sales) -

22 YearQtrMonSalesDelta Q1120 Jan30 Feb4010 Mar5010 Q Apr6515 May45-20 Jun9045 Q Jul55-35 Aug6015 Sep7010 Q Oct8010 Nov10020 Dec1055 Results For Question 1:

23 2. How Did Sales In The Current Period Compare With Sales In The Same Period Last Year? YearQtrMonSales Q1120 Jan30 Feb40 Mar50 Q4285 Oct80 Nov100 Dec Q1170 Jan50 Feb55 Mar65 Q4275 Oct90 Nov100 Dec85

24 YearQtrMonSalesAnnual Delta Q1120 Jan30 Feb40 Mar Q1170 Jan5020 Feb55 Mar65 2. How Did Sales In The Current Period Compare With Sales In The Same Period Last Year? (Time.CurrentMember, Measures.Sales)- (Time.CurrentMember.Lag(12), Measures.Sales)

25 YearQtrMonSalesAnnual Delta Q1120 Jan30 Feb40 Mar Q1170 Jan5020 Feb55 Mar65 2. How Did Sales In The Current Period Compare With Sales In The Same Period Last Year? (ParallelPeriod(Year,1,Time.CurrentMember), Measures.Sales) (Time.CurrentMember,Lag(12), Measures.Sales) (Time.CurrentMember, Measures.Sales)-

26 YearQtrMonSalesAnn. Delta Q1120 Jan30 Feb40 Mar50 Q4285 Oct80 Nov100 Dec Q Jan5020 Feb5515 Mar6515 Q Oct9010 Nov1000 Dec85-20 Results For Question 2:

27 3. What Have My Sales Been Since The Beginning Of The Year? YearQtrMonSales Q1120 Jan30 Feb40 Mar50 Q2200 Apr65 May45 Jun90 Q3185 Jul55 Aug60 Sep70 Q4285 Oct80 Nov100 Dec105

28 Time.Mar,Measures.Sales... Time.Jan,Measures.Sales + Time.Feb,Measures.Sales+ 3. What Have Sales Been Since The Beginning Of The Year? YearQtrMonSalesYTD Q1120 Jan30 Feb4070 Mar50120

29 Time.Mar,Measures.Sales Time.Jan,Measures.Sales + Time.Feb,Measures.Sales+ 3. What Have Sales Been Since The Beginning Of The Year? = Sum(YTD(Time.CurrentMember), Sales) YearQtrMonSalesYTD Q1120 Jan30 Feb4070 Mar50120

30 YearQtrMonSalesYTD Q1120 Jan30 Feb4070 Mar50120 Q Apr65185 May45230 Jun90320 Q Jul55375 Aug60435 Sep70505 Q Oct80585 Nov Dec Results For Question 3:

31 Questions


Download ppt "Atlanta.MDF MDX Overview. What Is MDX? MDX is Multi Dimensional EXpressions MDX is the syntax for querying an Analysis Services database MDX is part of."

Similar presentations


Ads by Google