Tomislav Piasevoli SoftPro Tetral d.o.o.. Tomislav Piasevoli  Business Intelligence Specialist  SoftPro Tetral company (Croatia)  6 years experience.

Slides:



Advertisements
Similar presentations
Presentation held by Tomislav Piasevoli at the local WinDays 11 conference, Rovinj, Croatia. Monday, 16:10-17:00, Room 6.
Advertisements

Adam Jorgensen Pragmatic Works Performance Optimization in SQL Server Analysis Services 2008.
Cache –Warming Strategies for Analysis Services 2008 Chris Webb Crossjoin Consulting Limited
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.
1 Programming Languages (CS 550) Lecture Summary Functional Programming and Operational Semantics for Scheme Jeremy R. Johnson.
SharePoint 2010 Business Intelligence Module 11: Performance Point.
1 CSC 551: Web Programming Spring 2004 client-side programming with JavaScript  scripts vs. programs  JavaScript vs. JScript vs. VBScript  common tasks.
DENORMALIZATION CSCI 6442 © Copyright 2015, David C. Roberts, all rights reserved.
SQL Server Accelerator for Business Intelligence (SSABI)
Introduction To MDX Dustin Ryan. A little bit about me…  Business Intelligence Consultant, Pragmatic Works  Technical editor for the many authors at.
Technical BI Project Lifecycle
Experiments on Query Expansion for Internet Yellow Page Services Using Log Mining Summarized by Dongmin Shin Presented by Dongmin Shin User Log Analysis.
Chapter 11 Group Functions
OLAP Services Business Intelligence Solutions. Agenda Definition of OLAP Types of OLAP Definition of Cube Definition of DMR Differences between Cube and.
Database Systems: Design, Implementation, and Management Tenth Edition
Clarity Educational Community Clarity Educational Community Creating and Tuning SQL Queries that Engage Users.
Implementing Business Analytics with MDX Chris Webb London September 29th.
Introduction Paul Turley SqlServerBiBlog.com Mentor, SQL Server MVP
Academic Year 2014 Spring.
Indexing XML Data Stored in a Relational Database VLDB`2004 Shankar Pal, Istvan Cseri, Gideon Schaller, Oliver Seeliger, Leo Giakoumakis, Vasili Vasili.
Realizing Business Insights with PowerPivot
2009 Mathematics Standards of Learning Training Institutes Algebra II Virginia Department of Education.
Exploring Microsoft Excel 97 Chapter 3 Spreadsheets in Decision Making: What If? Office graphic copyright by Microsoft Corp.
Introduction to Solving Business Problems with MDX Robert Zare and Tom Conlon Program Managers Microsoft.
SQL Server Integration Services (SSIS) Presented by Tarek Ghazali IT Technical Specialist Microsoft SQL Server (MVP) Microsoft Certified Technology Specialist.
Data Warehouse & Data Mining
IST722 Data Warehousing Business Intelligence Development with SQL Server Analysis Services and Excel 2013 Michael A. Fudge, Jr.
Systems analysis and design, 6th edition Dennis, wixom, and roth
Performance Tuning Cubes and Queries in Analysis Services 2008 Chris Webb
Lesson 31: Querying a Database. 2 Learning Objectives After studying this lesson, you will be able to:  Create, save, and run select queries  Design.
Stacks & Recursion. Stack pushpop LIFO list - only top element is visible top.
Solving Business Problems In OLAP Services Using MDX – Part I Amir Netz – Dev Manager & Architect Ariel Netz – Program Manager SQL Server OLAP Services.
Vidas Matelis, Toronto SQL Server User Group November 13, 2008.
Physical Database Design & Performance. Optimizing for Query Performance For DBs with high retrieval traffic as compared to maintenance traffic, optimizing.
Optimizing Time-Series Calculations in SSAS
Object-Oriented Program Development Using Java: A Class-Centered Approach, Enhanced Edition.
BI Terminologies.
ANALYSIS OF VARIANCE (ANOVA) BCT 2053 CHAPTER 5. CONTENT 5.1 Introduction to ANOVA 5.2 One-Way ANOVA 5.3 Two-Way ANOVA.
1 Relational Algebra Chapter 4, Sections 4.1 – 4.2.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
DAT 332 SQL Server 2000 Data Transformation Services (DTS) Best Practices Euan Garden Product Unit Manager SQL Server Development Microsoft Corporation.
Building Dashboards SharePoint and Business Intelligence.
 Enhancing User Experience  Why it is important?  Discussing user experience one-by-one.
What is OLAP?.
MDX Overview. 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.
12 1 Database Systems: Design, Implementation, & Management, 6 th Edition, Rob & Coronel 12.4 Online Analytical Processing OLAP creates an advanced data.
Thavash Govender Senior BI Consultant iSolve Business Solutions BIN307.
Session id: Darrell Hilliard Senior Delivery Manager Oracle University Oracle Corporation.
2 Advanced Dashboard Creation With Microsoft Office PerformancePoint Server 2007 Myles Matheson & Chris Du Toit Information Management Practice HP New.
Mailto : for all Hyperion video tutorial/Training/Certification/Material Understanding MDX with BSO and ASO.
Drill-Through Features Cognos 8 BI. Objectives  In this module we will examine:  Cognos 8 Drill Through Overview  Model / Package Drill Through  Cross.
Alyson Powell Erwin Sr. Program Manager Microsoft BIN307.
DAT 378 SQL Server 2000 Bringing The Best of Reporting Services and Analysis Services Together Sean Boon Program Manager, BI Systems
Intro to Power BI Azhagappan Arunachalam.  Senior Database Architect   PowerBICentral.com  (blog on getting started.
Albert J. Moore, ASA, MAAA Ohio National Financial Services Chairman, SOA Technology Section August 1, 2014 IABA Conference New Orleans, LA.
Advanced MDX Tips And Tricks Chris Webb. Who Am I? Chris Webb UK-based consultant and trainer:
8 Copyright © 2006, Oracle. All rights reserved. Previewing Advanced Oracle OLAP Features.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Data Warehousing and Decision Support Chapter 25.
1 Database Systems, 8 th Edition Star Schema Data modeling technique –Maps multidimensional decision support data into relational database Creates.
7 Copyright © 2006, Oracle. All rights reserved. Creating Experts.
BTM 382 Database Management Chapter 8 Advanced SQL Chitu Okoli Associate Professor in Business Technology Management John Molson School of Business, Concordia.
Advanced Analysis Services Security Chris Webb Crossjoin Consulting Limited.
INTRODUCTION TO MDX. Stick around for RAFFLE and the AFTER EVENT!  All our volunteers and organisers do not get paid for organizing this event – If.
<Enter course name here>
SQL Server Analysis Services Fundamentals
6/16/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Relational Algebra 461 The slides for this text are organized into chapters. This lecture covers relational algebra, from Chapter 4. The relational calculus.
MANAGING DATA RESOURCES
Building your First Cube with SSAS
Module 8: Introduction to MDX Module 8 Introduction to MDX
Presentation transcript:

Tomislav Piasevoli SoftPro Tetral d.o.o.

Tomislav Piasevoli  Business Intelligence Specialist  SoftPro Tetral company (Croatia)  6 years experience with SSAS  Specialties:  cube design  MDX  Activities:  Microsoft SSAS forum  Blog  Conferences

SoftPro Tetral Microsoft Certified Solution Provider since Platinum Member of Data Warehousing Alliance od FUSION Finalist – Packaged Application of the Year FUSION Finalist – Packaged Application of the Year FUSION Finalist – BI Solution of the Year Veritest Certificate Certified Member of Data Warehousing Alliance od Microsoft Gold Certified Partner since European IT Excellence Awards Finalist – Solution Provider European IT Excellence Awards Finalist – ISV (BI Category)

Session topic  Among many of its functions, MDX language has one special set function - Axis() function. That function allows creation of calculated measures that are fully context aware and, if wanted, don't need to refer to any dimension or hierarchy in the cube. In other words, such measures are universal or independent, which means they can be used in any MDX query.Axis()  In this session we will present such measures and explain how they work. We'll also show the way how to design them for various scenarios and discuss their potentials and weaknesses.  Previous experience in writing MDX queries is recommended.

First steps

Axes demistified  Axes in general  Projection of hierarchies on axes  Decomposition of axis: Set, tuples, hierarchies, current members  Navigation: First/last, n-th, previous/next tuple  Query execution phases

Simple calculations (one hierarchy on Axis(1)  Name  UniqueName  Level  Level name  Level ordinal  Min/Max Level ordinal  Parent  Set rank  Level rank  Siblings rank  Hierarchy  Ancestor N  Prev/Next Member ...

Advanced calculations

MDX constructs  Testing if an axis is present in query  Rows/columns (axes) sets  Count of rows/columns (records on axes)  Count of hierarchies on axes  Static vs. Dynamic constructs (query session members defined before vs. Iteration with loops)  Pre-evaluate vs. Post-evaluate (pick a tuple vs. String handling delay StrToValue/StrToTuple)

Rank of measure MEMBER [Measures].[Sales Amount Rank] AS iif( IsEmpty( [Measures].[Sales Amount] ), null, Rank( Axis(1).Item(0).Item( Axis(1).Item(0).Count - 1 ).Hierarchy.CurrentMember, Order( Extract( Axis(1), Axis(1).Item(0).Item( Axis(1).Item(0).Count – 1 ).Hierarchy ), [Measures].[Sales Amount], BDESC ) ) )

MEMBER [Measures].[Row Number] AS Rank( StrToTuple( "( " + Generate( Head( Axis(1), Axis(1).Item(0).Count ) AS RN, "Axis(1).Item(0).Item(" + CStr( RN.CurrentOrdinal – 1 ) + ").Hierarchy.CurrentMember", ", “ ) + " )" ), Axis(1) ), Format_String = "#,#" Row number

MEMBER [Measures].[Column Number] AS Rank( StrToTuple( "( " + Generate( Head( Axis(0), Axis(0).Item(0).Count ) AS CN, "Axis(0).Item(0).Item(" + CStr( CN.CurrentOrdinal – 1 ) + ").Hierarchy.CurrentMember", ", “ ) + " )" ), Axis(0) ), Format_String = "#,#" Column number

Possible calculations  Row number  Column number  Rank of declared measure  Rank of measure with absolut position on axis  Rank of measure with relative position on axis  Rank based on root member  Rank based on declared ancestor  Rank based on parent  Percentage of rows total  Precentage of columns total  Arithmetic array  Geometric array  Running total  Variance  Max/min coloring  Normalized value (% in max)  Max result on cellset  Random sample  Max/min in parent/hierarchy before ...

Building a Framework

SET [Rows] AS {Axis(1) } MEMBER [Number of rows] AS [Rows].Count -- derived from Axis(1).Count SET[1st Tuple on rows] AS { [Rows].Item(0) } -- derived from { Axis(1).Item(0) } SET [Last Tuple on rows] AS { [Rows].Item( [Number of rows] - 1 ) } -- derived from { Axis(1).Item( Axis(1).Count – 1 ) } MEMBER [Number of Hierarchies on rows] AS [1st Tuple on rows].Count -- derived from Axis(1).Item(N).Count, where N >= 0 -- i.e. Axis(1).Item(0).Count SET[1st Member in last Hierarchy on rows] AS { [1st Tuple on rows].Item( [Number of Hierarchies on rows] - 1 ) } MEMBER [Current Member in last Hierarchy on rows] AS [1st Member in last Hierarchy on rows].Item(0).Hierarchy.CurrentMember.Name MDX Expressions

MEMBER [Measures].[Sales Amount Rank] AS iif( IsEmpty( [Measures].[Sales Amount] ), null, Rank( [Member on the last column]--.Hierarchy.CurrentMember, Order( Extract( [Rows], [Member on the last column].Hierarchy ), [Measures].[Sales Amount], BDESC ) ) ) Rank of measure (simplified version)

Techniques

 Testing for presence (of axis or measures on them)  Preserving count of tuples on axis (avoiding interference with query)  Static vs. Dynamic constructs (query session members defined before vs. Iteration with loops)  Pre-evaluate vs. Post-evaluate (pick a tuple vs. String handling delay StrToValue/StrToTuple)  MDX injection (forcing non-determinism)  Trojan horses (exploiting current context)  Time-machine (exploiting query execution phases)

IsError( Axis(1).Count ) IsError( Axis(0).Count ) IsError( Extract( Axis(1), Measures ) ) IsError( Extract( Axis(0), Measures ) ) IsError( Extract( Axis(1), [Universal calculations].[Calculation] ) [Rows measures evaluated].Count > 0 [Columns measures evaluated].Count > 0 IsEmpty( [Query measures evaluated].Item(0).Item(0).Value ) IsEmpty( [Column Measures].Item(0).Item(0).Value ) Testing for presence (recognizing things in the dark)

Create DYNAMIC SET CurrentCube.[Query measures evaluated] AS iif( Measures.CurrentMember Is Measures.DefaultMember, iif( IsError( Axis(1).Count ), iif( IsError( Axis(0).Count ), { Measures.CurrentMember }, iif( IsError( Extract( Axis(0), Measures ).Count ), { Measures.CurrentMember }, Extract( Axis(0), Measures ) ) ), iif( IsError( Extract( Axis(1), Measures ).Count), { Measures.CurrentMember }, Extract( Axis(1), Measures ) ) ), { Measures.CurrentMember } ) Trojan for Dynamic Sets (enables the use of Axis() inside dynamic sets)

MEMBER [Hierarchy on axis name] AS Axis(1).Item(0).Item(0).Hierarchy.Name MEMBER [Number of Hierarchies in cube] AS Dimensions.Count MEMBER [Random Hierarchy ordinal] AS Int( [Number of Hierarchies in cube] * Rnd() ) MEMBER [Random number per row] AS Rnd( Rank( Axis(1).Item(0).Item(0).Hierarchy.CurrentMember, Axis(1).Item(0).Item(0).Hierarchy.CurrentMember.Level.Members) ) MEMBER [Random Hierarchy per row ordinal] AS Int( [Number of Hierarchies in cube] * [Random number per row] ) MEMBER [Random Hierarchy per row name] AS Dimensions( [Random Hierarchy per row ordinal] ).Name MDX injection (per row evaluation)

NonEmpty( Axis(1), [Query measures evaluated] ) NonEmpty( Axis(1), [Universal calculations].[Calculation].[Value] ) Preserving count of tuples (complying to NON EMPTY)

Utility dimension

 Implement all calculations as calculated members in utility dimension built into cube especially for that reason  Implementing calculations on a dimension other than measures helps to avoid the reference to that measure itself in calculations (Measures.CurrentMember paradox)

Cube-based calculations

 Implement all calculations as calculated members in measures dimension only if your current front-end handles that better  Or if SSRS is the primary tool for analysis/reporting  More complex (and hence slower) than scenario with utility dimension

Summary

SWOT analysis for Axis expressions STRENGTHS  independent of cube structure  anything-based (query, session, cube) WEAKNESSES  limited support in some front- ends  steep learning curve  slower query responses (no caching)  require performance fine-tuning OPPORTUNITIES combination with utility dimensions and dynamic sets (cube-based) MDX enhancements for front- ends (session- or query-based) THREATS some front-ends switch objects on axes at will extremely complex matter (possibility of hidden false results)

Alternative - front-end (grid) features - stored procedures - nothing (stick to your existing calculations and cube design)

Conclusion  UCM (universal calculated measures) can be used on any project  Independant of metadata (cube, dimensions)  UCM enable advanced analytics  possibly not available in currently used front-end  UCM enable reduction of calculations in cubes  Just like utility dimensions (with YTD, etc) do  UCM can be implemented as  Query-based (for simple scenarios or reporting)  Session-based (if front-end supports it)  Cube-based using calculated measures (for reporting)  Cube-based using utility dimension (for enhanced representation of data)

Resources  Books Online  MDX Solutions (2nd Edition)  Microsoft SSAS 2008 Unleashed  MSDN SSAS forum  Projects, queries, etc. can be downloaded from: (starting from April 1st, 2009.)