Presentation is loading. Please wait.

Presentation is loading. Please wait.

DENMARK ICELAND FINLAND NORWAY ITU Business Intelligence Introduction to OLAP STIG TORNGAARD HAMMEKEN KONSULENTDIREKTØR The.

Similar presentations


Presentation on theme: "DENMARK ICELAND FINLAND NORWAY ITU Business Intelligence Introduction to OLAP STIG TORNGAARD HAMMEKEN KONSULENTDIREKTØR The."— Presentation transcript:

1 WWW.PLATON.NET DENMARK ICELAND FINLAND NORWAY ITU Business Intelligence Introduction to OLAP STIG TORNGAARD HAMMEKEN KONSULENTDIREKTØR STO@PLATON.NET The OLAP introduction is based on Microsoft Analysis Services technology and terminology.

2 © Platon Agenda ●9.00 – 12.00 Introduction to OLAP ●Why OLAP ●Microsoft Analysis Services ●Introduction to the HR exercise ●12.00 – 13.00 Lunch ●13.00 – 16.00 Exercise (Room 2A52) ●Design and develop a HR headcount model ●Time dimension ●Employee dimension (TYPE 1) ●Organisation (TYPE 2) ●Semiadditive measure: Average Headcount ●Browse the model using front-end tool ●i.e. Excel, Reporting Services Page 2 Side 2

3 © Platon Business Analysts needs structured information DK N S Salg i stk Omsætning Variable omkostn. Dækningsbidrag Valuta Tid Dage Uger Måneder Kvartaler År Produkt Magasiner - Produkt A Ugeblade - Produkt B Organisation Division A - Afdeling A1 - Afdeling A2 Division B - Afdeling B1 - Afdeling B2 Marked Fakta DKK SEK NOK EUR

4 © Platon Demo - ”I want my analysis in Excel” Page 4

5 © Platon …and they need it fast and friendly Small Data volume Large Complex Simple Formulas OLAP Database Spreadsheet Slow Queries

6 © Platon Why OLAP ●User friendly ●Larger user community (pervasive BI) ●Meta data ●Navigation path ●No complex end-user queries – or errounous queries ●No understading of underlying databases – must be intuitive! ●Real-time analytics ●Complex business rules required ●Information insted of ”just data” ●”The business world is multi dimensional” Page 6

7 © Platon The OLAP terminology - SSAS terminology ●Database ●Cube ●Measure Group ●Measure ●Calculated Measure ●KPI ●Dimension ●Display Folder ●Hierarchy ●Attribute/Member ●Calculated Member ●Property ●Actions ●MDX ●And many more… Page 7

8 © Platon Cubes and Measure Groups ●A database is a collection of cubes ●Cubes is really ”a Cube” ●Assembly of measure groups ●Marketing calls it the “Unified Dimension Model” (UDM) ●Physical storage may be OLAP or relational (Partitions) ●Measure groups ●Combine fact tables of different grain ●Similar to cube in AS2K ●One measure group per (logical) fact table ●Map grain of dimension to measure group

9 © Platon MDX Foundation A cube is essentially a multi-dimensional spreadsheet ●Contains cells ●Cell address (coordinate) is called a Tuple ●Tuple consists of one member from each dimension (explicit or by default) MDX Tuple: (USA, January, Headcount) Spreadsheet: Sheet1!A1

10 © Platon Multidimensional Coordinate Terminology ●1 Dimension — Single Coordinate (point) ●2 Dimensions — Double Coordinate ●3 Dimensions — Triple Coordinate ●4 Dimensions — Quadruple Coordinate ●5 Dimensions — Quintuple Coordinate ●6 Dimensions — Sextuple Coordinate ●7 Dimensions — Septuple Coordinate ●Generic Term — Tuple ([Sales Units], [Bread], [USA], [1998]) Tuple: A list of members from different hierarchies separated by commas and enclosed in parentheses

11 © Platon Tuples: Based on Intersects MDX select statement : SELECT {Units, Dollars} ON COLUMNS, {Gadgets, Widgets} ON ROWS FROM Sales WHERE ([2001]) ( Geo.All, [2001], Gadgets, Dollars ) MDX Tuple:

12 © Platon MDX Sets ●A set is a collection of dimensionally symmetrical tuples: { (Gadget, Q1), (Widget, [2001]) } tuple tuple ●Even a “simple” set is a set of tuples: {East, West} same as: {(East), (West)} ● Rich set of Set functions available ●Generate ●TopCount ●Filter ●Union ●Etc.

13 © Platon Dimensions - Hierarchy types + Unbalanced Standard RaggedNormal + +

14 © Platon Dimensions - Dimensions types ●Star schema dimensions ●Snow-flake dimensions ●Parent-Child dimensions PC Hierarchy Pros and Cons Limitations: ●Only one Parent attribute per dimension ●Can be confusing in client UI ●Performance is not optimal Strengths: ●Easily handle arbitrary number of levels ●Unary Operators ●Aggregate by Account Type (semi-additive over time)

15 © Platon Dimensions ●Alternate hierarchies ●Within single dimension – i.e. multiple calendars ●Calendar – Fiscal – Weeks ●Role-playing dimensions ●Separate fact table foreign keys ●Order Date – Ship Date – Due Date ●Each reuses all hierarchies of date dimension

16 © Platon Measures and calculations ●Measures ●Sum can be calculated from any level ●Semi-additive; Additive over all dimensions but time ●examples: Inventory, Headcount ●i.e. “Average of Children” ●Non additive ●i.e. Distinct Count ●Calculated Measures (MDX expressions) ●Tuple based ●Average Price = [Sales Amount] / [Order Quantity] (Like Excel references: =B5/B4) ●Set based ●Year To Date = Sum(YTD(),[Order Quantity]) ●Like Excel ranges: =Sum(B2:B10) Page 16

17 © Platon Pseudo-Additive Measures ●Weighted averages can be decomposed ●Sum(Units*Weight)/Sum(Weight) ●Hide the intermediate calculations ●Very fast in Analysis Services

18 © Platon Non-additive Measures ●Detail-based aggregations ●Median, Mode ●Consequences ●Cannot be calculated at arbitrary level ●Cannot be calculated from components ●Affect all subsequent calculations ●May be cached, but with data explosion ●Special Case: Distinct Count

19 © Platon Non-Additive Special Case: Distinct Count ●AS2005 provides support, but not trivial CustomerProductDay jsmithWine4/16/99 dharrisBeer4/16/99 jsmithWine4/16/99 kyoungWine4/16/99 dharrisWine4/17/99 dharrisWine4/17/99 jsmithBeer4/17/99 dharrisBeer4/17/99 All ProductsWineBeer All Time844 4/16/99532 4/17/99312 All ProductsWineBeer All Time 3 3 2 4/16/99321 4/17/99 2 12 How many customers bought wine and beer each day? DISTINCT

20 © Platon Advanced - Financial Accounts ●Normally define aggregations per measure ●Account dimension acts like measures ●Account Types ●Asset, Liability, Balance ●Income, Expense, Flow ●Statistical ●Use ByAccount aggregate function ●Use pre-defined names and functions ●Customize aliases and functions in.database file

21 © Platon Advanced - Accounting Sign Reversal ●Expense values appear positive, act negative ●Profit=Revenue-Expenses ●Solution ●Flag each member with how it should affect its parent ●Store flag as column in dimension table

22 © Platon Calculated Members - Percent of Total MDX Expression: WITH MEMBER Measures.[% Total] AS ‘ (Product.CurrentMember, [Store Sales]) / (Product.DefaultMember, [Store Sales]) ' Current Iteration: Calculates for current member of all other dimensions

23 © Platon KPIs ●Key Performance Indicators ●Calculate Value, Goal, Status, Trend, Weight, Gauge ●MDX expressions ●Accessible from client application (Excel)

24 © Platon The SSAS Development Tool ●Development: ●Business Intelligence Development Studio ●Mainatenance: ●Management Studio ●Live demonstration using BI Development Studio Page 24

25 © Platon Agenda ●9.00 – 12.00 Introduction to OLAP ●Why OLAP ●Microsoft Analysis Services – the tool and terminology ●Introduction to the HR exercise ●12.00 – 13.00 Lunch ●13.00 – 16.00 Exercise (Room 2A52) ●Design and develop a HR headcount model ●Time dimension ●Employee dimension (TYPE 1) ●Organisation (TYPE 2) ●Semiadditive measure: Average Headcount ●Browse the model using front-end tool ●i.e. Excel, Reporting Services Page 25 Side 25

26 © Platon HR Excersice - Requirements ●Design and develop a HR headcount model ●Time dimension (YQMD hierarchy) ●Employee dimension (History: TYPE 1, Member properties in display folders) ●Organisation (History: TYPE 2) ●Measure: Average Headcount (Semiadditive: average of children) ●Make a simple report Page 26

27 © Platon HR Exercise - Requirement details ●Time dimension ●Create a YQMD hierarchy ●Employee dimension ●Member properties in display folder (demogrph) ●Named Calculation: Age: ●Auto Grouping of Age: 5 Intervals ●Two user hierarchies: Gender and Employees ●Organisation dimension ●Named Query: SELECT Department, GroupName, FullName, DWID_Employee, Department + CAST(DWID_Employee AS varchar(5)) AS HistoryKey FROM fact.Headcount ●Remember to set attribute relationship (1-1, 1-M) ●Fact ●Extend DSV with HistoryKey: department+cast(dwid_employee as varchar(5)) ●Measure: AVG Headcount (Semiadditive: average of children) Page 27

28 © Platon HR Excercise - The output (result) Page 28

29 © Platon HR Excersice - The explode SQL in i.e. a DSV Page 29 SELECT edh.EmployeeID,edh.Title,edh.FirstName,edh.MiddleName,edh.LastName, edh.Suffix,edh.Shift,edh.Department,edh.GroupName, edh.StartDate,t.dwid_Date, department+cast(employeeid as varchar(5)) as HistoryKey, 1 as HeadCount, isnull(edh.enddate, cast(convert(varchar, getdate(),112) as datetime)) as enddate FROM AdventureWorks.HumanResources.vEmployeeDepartmentHistory as edh INNER JOIN ITUDW.dim.Periode AS t ON DW_TS_From between startdate AND CASE WHEN isnull(edh.enddate, '') = '' THEN cast(convert(varchar, getdate(),112) as datetime) ELSE edh.enddate END

30 © Platon Agenda ●9.00 – 12.00 Introduction to OLAP ●Why OLAP ●Microsoft Analysis Services – the tool and terminology ●Introduction to the HR exercise ●12.00 – 13.00 Lunch ●13.00 – 16.00 Exercise (Room 2A52) ●Design and develop a HR headcount model ●Time dimension ●Employee dimension (TYPE 1) ●Organisation (TYPE 2) ●Semiadditive measure: Average Headcount ●Browse the model using front-end tool ●i.e. Excel, Reporting Services Page 30 Side 30

31 © Platon Further reading ●Brief introduction to MDX ●http://www.mosha.com/msolap/articles/MDXForEveryone.htmhttp://www.mosha.com/msolap/articles/MDXForEveryone.htm ●Introduction to Analysis Services ●Books Online ●http://msdn2.microsoft.com/en-us/library/ms175609.aspxhttp://msdn2.microsoft.com/en-us/library/ms175609.aspx ●Analysis Services Tutorials ●http://msdn2.microsoft.com/en-us/library/ms170208.aspxhttp://msdn2.microsoft.com/en-us/library/ms170208.aspx ●Lesson 1: Defining a Data Source View within an Analysis Services Project ●Lesson 2: Defining and Deploying a Cube ●Lesson 3: Modifying Measures, Attributes and Hierarchies ●Lesson 4: Defining Advanced Attribute and Dimension Properties ●Lesson 5: Defining Relationships Between Dimensions and Measure Groups ●Lesson 6: Defining Calculations ●A good practical book: ●Microsoft® SQL Server™ 2005 Analysis Services Step by Step Page 31


Download ppt "DENMARK ICELAND FINLAND NORWAY ITU Business Intelligence Introduction to OLAP STIG TORNGAARD HAMMEKEN KONSULENTDIREKTØR The."

Similar presentations


Ads by Google