Presentation is loading. Please wait.

Presentation is loading. Please wait.

MDX G OTCHA ! S …or how to keep your hair dark…. Y OUR S PEAKER Boyan Penev Microsoft MVP: SQL Server for 2011 Expertise SSAS PowerPivot SSRS SSIS etc,

Similar presentations


Presentation on theme: "MDX G OTCHA ! S …or how to keep your hair dark…. Y OUR S PEAKER Boyan Penev Microsoft MVP: SQL Server for 2011 Expertise SSAS PowerPivot SSRS SSIS etc,"— Presentation transcript:

1 MDX G OTCHA ! S …or how to keep your hair dark…

2 Y OUR S PEAKER Boyan Penev Microsoft MVP: SQL Server for 2011 Expertise SSAS PowerPivot SSRS SSIS etc, etc, etc (you get the point ;) Blog: www.bp-msbi.comwww.bp-msbi.com

3 Q UICK A GENDA MDX Problems Incorrect Data Models Under-used SSAS functionality Inefficient MDX Detecting Problems Demo (some examples)

4

5 MDX P ROBLEMS ( RE : D ATA M ODEL ) Leaf-Level Calculations SUM(DESCENDANTS(,,LEAVES), / ) SCOPE(LEAVES( ); This = / ; END SCOPE; Alternatives ETL, DB Views, DSV: / Demo

6 Root (All) 2008 Jan 2008 01/01/2008 … 31/01/2008 Feb 2008 01/02/2008 … 29/02/2008 … … … … Dec 2008 01/12/2008 … 31/12/2008 2009Jan 2009 Leaves

7 MDX P ROBLEMS ( RE : D ATA M ODEL ) Date Calculations ParallelPeriod() ClosingPeriod() YTD(), QTD(), MTD() Common Causes Incomplete Date Dimensions (gaps, missing members) Wrong Structure (hierarchies, att rels) Dimensions not marked as Time

8 2008 Q1 08 Mar 2008 Q2 08 Apr 08 May 08 Jun 08 Q3 08 Jul 08 Aug 08 Q4 08 Oct 08 Nov 08 Dec 08 Closing Period(Q3 08) = Aug 08 ParallelPeriod(Quarter, Apr 08) = Mar 08

9

10 MDX P ROBLEMS ( RE : SSAS F UNCTIONALITY ) Semi-Additive Measures in EE Replicating the same behaviour in MDX Many 2 Many Relationships Performing SQL-style JOINs in MDX Measure Expressions Writing them in MDX Note that aggregations are not used with MEs

11 Fact A Dim1 Dim2 Dim3 Dim4 Fact B Dim1 Dim2 FactA.MeasureA (+-*/) FactB.MeasureB

12

13 MDX P ROBLEMS ( RE : I NEFFICIENT MDX) Using IIF instead of SCOPE (> importance in 2005) IIF(a.CurrentMember Is, NULL, ) is the same (functionally) as: SCOPE( ); This = NULL; END SCOPE;

14 MDX P ROBLEMS ( RE : I NEFFICIENT MDX) Set Operations Filter(..,..CurrentMember.MemberValue < 20110315) is equivalent to: {NULL:...&[20110315]} Demo

15 MDX P ROBLEMS ( RE : I NEFFICIENT MDX) Using VBA/Excel Functions VBA!Format() ~ FORMAT_STRING VBA!DateAdd() =....NextMember, or....PrevMember, or....Lag(n), or....Lead(n) VBA!DateDiff() = {... :... }.Count Demo

16 MDX P ROBLEMS ( RE : I NEFFICIENT MDX) StrToSet and StrToMember Use sparingly LinkMember, LookupCube Avoid at all costs Filter Often over-used, be cautious

17 D ETECTING P ROBLEMS Execution Time SQL Server Profiler Excessive number of data requests Touching too many partitions and aggregations Performance Monitor Several SSAS MDX counters Bulk mode evaluation nodes Cell-by-Cell evaluation nodes Number of cells evaluated Memory/CPU Utilisation

18 Q …and hopefully some A


Download ppt "MDX G OTCHA ! S …or how to keep your hair dark…. Y OUR S PEAKER Boyan Penev Microsoft MVP: SQL Server for 2011 Expertise SSAS PowerPivot SSRS SSIS etc,"

Similar presentations


Ads by Google