Tasting the Flavors of Analysis Services 2012 Building up the foundation for Enterprise Analytics Alan Koo PRPASS Co-Founder & President Senior Consultant Nagnoi, Inc. Blog: www.alankoo.com Twitter: @alan_koo www.facebook.com/prpass
Complete the Evaluation Form to Win! Win a book just for submitting your completed form. Each session evaluation form represents a chance to win. www.facebook.com/prpass Pick up your evaluation form: In each presentation room Drop off your completed form: Near the exit of each presentation room
Who am I? Co-Founder of Puerto Rico PASS Senior Consultant at Nagnoi, Inc. 12+ years on SQL Server 7+ years on BI & OLAP Former Microsoft MVP (2008 2011) Blogger: www.alankoo.com Tasting the Flavors of SSAS 2012 SQL Saturday Puerto Rico Alan Koo www.alankoo.com
What will we be covering today? Flavors of Analysis Services 2012 The BI Semantic Model Multidimensional vs Tabular Scenarios Thoughts Tasting the Flavors of SSAS 2012 SQL Saturday Puerto Rico Alan Koo www.alankoo.com
Analysis Services 2012 Flavors Personal BI: PowerPivot for Excel 2010 Team BI: PowerPivot for Sharepoint Corporate BI (SSDT): Analysis Services 2012 Tabular Analysis Services 2012 Multidimensional Tasting the Flavors of SSAS 2012 SQL Saturday Puerto Rico Alan Koo www.alankoo.com
BI Semantic Model: The Analysis Services 2012 Foundation One Model for all End User Experiences Client Tools Analytics, Reports, Scorecards, Dashboards, Custom Apps BI Semantic Model Personal BI PowerPivot for Excel Team BI PowerPivot for SharePoint Organizational BI Analysis Services Data Sources Databases, LOB Applications, OData Feeds, Spreadsheets, Text Files Tasting the Flavors of SSAS 2012 SQL Saturday Puerto Rico Alan Koo www.alankoo.com
BI Semantic Model: The Analysis Services 2012 Foundation From Personal to Corporate BI Tasting the Flavors of SSAS 2012 SQL Saturday Puerto Rico Alan Koo www.alankoo.com
BI Semantic Model: Architecture Third-party applications Report View Reporting Services Excel PowerPivot SharePoint Insights Databases LOB Applications Files OData Feeds Cloud Services Tasting the Flavors of SSAS 2012 SQL Saturday Puerto Rico Alan Koo www.alankoo.com
demo
Multidimensional vs Tabular BISM Multidimensional (OLAP) Disc based Engine Dimensional Modeling Facts, Dimensions, Cubes Complex Relationships support Compression 3x Less memory than Tabular Support very large amounts of data (TB) MDX Script Powerful, complex BISM Tabular (PowerPivot) (xvelocity) In-Memory Engine Relational Modeling Tables Basic Relationships (1:N) Compression 10x or much more! More memory requirements Data size supports depends on available memory (GB?) DAX Calculated Columns Measures Tasting the Flavors of SSAS 2012 SQL Saturday Puerto Rico Alan Koo www.alankoo.com
BISM Decision Matrix Feature or Business Need PowerPivot for Excel PowerPivot for SharePoint Analysis Services Tabular Ability to use Power View No Yes (because it uses DAX) Yes (because it uses DAX) No (yet?) Analysis Services Multidimensional Type of Database Engines Size of Dataset Ability to Pass Through Query to Underlying Data Source Many-to-Many Relationships Supported Writeback Supported Upgrade / Maturity Path xvelocity (all data is highly compressed & fits into memory) File size: 2gb limit (after compression) Memory limit: 2gb (32-bit) or 4gb (64-bit) xvelocity (all data is highly compressed & fits into memory) File size: 2gb limit (after compression) (SharePoint size limitation) xvelocity (all data is highly compressed) Large (can partition; can use DirectQuery) OLAP Extremely Large (can partition; can use MOLAP & ROLAP) No No Yes (DirectQuery) Yes (DirectQuery) Yes (created via DAX, not built into the model directly) No (xvelocity structure is read only) To PowerPivot for SharePoint Yes (created via DAX, not built into the model directly) No (xvelocity structure is read only) To Analysis Services Tabular Yes (created via DAX, not built into the model directly) No (xvelocity structure is read only) N/A (not currently able to be upgraded into a Multidimensional model) Yes (built in the model) Yes N/A Tasting the Flavors of SSAS 2012 SQL Saturday Puerto Rico Alan Koo www.alankoo.com
BISM Model Features (1/2) Multidimensional Tabular PowerPivot Actions Yes No No Aggregations Yes No Yes Calculated Measures Yes Yes Yes Custom Assemblies Yes No No Custom Rollups Yes No No Distinct Count Yes Yes (via DAX) Yes (via DAX) Drillthrough Yes Yes Yes (detail opens in separate worksheet) Hierarchies Yes Yes Yes KPIs Yes Yes Yes Linked objects Yes No Yes (linked tables) Tasting the Flavors of SSAS 2012 SQL Saturday Puerto Rico Alan Koo www.alankoo.com
BISM Model Features (1/2) Multidimensional Tabular PowerPivot Many-to-many relationships Yes No No Partitions Yes Yes No Perspectives Yes Yes Yes Semi-additive Measures Yes Yes Yes Translations Yes No No User-defined Hierarchies Yes Yes Yes Writeback Yes No No Tasting the Flavors of SSAS 2012 SQL Saturday Puerto Rico Alan Koo www.alankoo.com
Security Feature Support PowerPivot: file level Tabular models: row-level Multidimensional models: cell-level Tasting the Flavors of SSAS 2012 SQL Saturday Puerto Rico Alan Koo www.alankoo.com
XMLA / ASSL PowerShell Query and Scripting Language Support Calculations Queries PowerPivot DAX DAX Tabular DAX, MDX DAX Multidimensional MDX MDX Data Mining n/a DMX Tasting the Flavors of SSAS 2012 SQL Saturday Puerto Rico Alan Koo www.alankoo.com
Analysis Services in Tabular Mode CHANGING YOUR MODELING APPROACH * Vertipaq vs OLAP - Marco Russo - SQLBI.com
Traditional OLAP with UDM (multidimensional) OLTP Data Warehouse DataMart OLAP Cube MDX Script MDX Queries Excel * Vertipaq vs OLAP - Marco Russo - SQLBI.com
BISM Tabular Simpler data model More data sources support (data feeds, ODBC and some document formats) Less dimensional tools Needs more memory Amazingly fast But Is speed the only advantage? * Vertipaq vs OLAP - Marco Russo - SQLBI.com
Dimensional Modeling Why do we use dimensional modeling? Easiness of use? Any DWH can turn into dimensional through views Speed! No DWH model will ever beat a good DM Excel! OLAP cubes need to be built on DM Excel query OLAP cubes In 2011, Dimensional Modeling was the only solution * Vertipaq vs OLAP - Marco Russo - SQLBI.com
BI Solutions with xvelocity OLTP Data Warehouse DataMart xvelocity Database xvelocity Database DAX Excel * Vertipaq vs OLAP - Marco Russo - SQLBI.com
Scenario WAREHOUSE STOCK ANALYSIS * Vertipaq vs OLAP - Marco Russo - SQLBI
Warehouse Stock Analysis Relational Model for Transactions * Vertipaq vs OLAP - Marco Russo - SQLBI.com
Warehouse Stock Analysis Traditional DW Snapshot Design * Vertipaq vs OLAP - Marco Russo - SQLBI.com
Warehouse Stock Analysis Common solution: Snapshot table with quantity on hold for each product/warehouse/day ETL calculation made by summing all transactions up to a given day BISM Tabular Can avoid snapshot by making up-to-date calculation at query time Reduces memory, leverages on xvelocity engine * Vertipaq vs OLAP - Marco Russo - SQLBI.com
Warehouse Stock Analysis Query to load the DW snapshot SELECT t.timekey, t.fulldatealternatekey, s1.* FROM dbo.dimtime t CROSS APPLY ( SELECT s.productkey, SUM(s.Quantity) AS Stock FROM dbo.factmovements s WHERE s.orderdatekey <= t.timekey GROUP BY s.productkey ) s1 WHERE DayNumberOfMonth = 1 * Vertipaq vs OLAP - Marco Russo - SQLBI.com
Customer Analysis MDX Query without Snapshot WITH MEMBER MEASURES.Stock AS SUM( NULL : [Date Order].[Calendar].CURRENTMEMBER, [Measures].[Order Quantity] ) SELECT Stock ON 0, NON EMPTY [Product].[Product].[Product].members FROM [Sales] * [Date Order].[Calendar].[Month].MEMBERS ON 1 * Vertipaq vs OLAP - Marco Russo - SQLBI.com
Warehouse Stock Analysis DAX query does not require snapshot The DAX query is faster: Stock : = CALCULATE( SUM( FactMovements[OrderQuantity] ), FILTER( ALL( DimTime ), DimTime[TimeKey] <= MAX(DimTime[TimeKey] ) ) ) * Vertipaq vs OLAP - Marco Russo - SQLBI.com
Scenario CUSTOMER ANALYSIS * Vertipaq vs OLAP - By Marco Russo - SQLBI
Customer Analysis The question: How many new distinct customers we had this month? Dimensional model Complex and slow query (either SQL or MDX) Slowness is caused by looking for the lack of an event in a dimensional model Optimization: monthly snapshot of new customers Possible shortcut: saving date of first and last sale for each customer Extraction logic embedded in ETL not flexible * Vertipaq vs OLAP - By Marco Russo - SQLBI
Customer Analysis Initial Data Model in a Classical Star Schema * Vertipaq vs OLAP - Marco Russo - SQLBI.com
Customer Analysis Solution Based on a Snapshot ETL Required * Vertipaq vs OLAP - By Marco Russo - SQLBI
Customer Analysis MDX Queries Relies on Distinct Count Measure WITH MEMBER MEASURES.TotalCustomers AS AGGREGATE( NULL : [Date].[Calendar].CURRENTMEMBER, [Measures].[Customer Count]) MEMBER MEASURES.NewCustomers AS MEASURES.TotalCustomers - AGGREGATE( NULL : [Date].[Calendar].PREVMEMBER, [Measures].[Customer Count]) MEMBER MEASURES.ReturningCustomers AS MEASURES.[Customer Count] - MEASURES.NewCustomers SELECT { [Measures].[NewCustomers], [Measures].[Customer Count], [Measures].[ReturningCustomers] } ON COLUMNS, [Date].[Calendar].[Month].MEMBERS ON ROWS FROM [Adventure Works] * Vertipaq vs OLAP - Marco Russo - SQLBI.com
Customer Analysis Why Distinct Count Calculation in OLAP is expensive Distinct Count calculation in OLAP is expensive Separate measure group Adding a distinct count measure requires modifications in OLAP schema Expensive processing (ORDER BY required) Different partitioning for query optimization * Vertipaq vs OLAP - By Marco Russo - SQLBI
Customer Analysis Solution with First / Last Transaction Date Update on Dimension Required * Vertipaq vs OLAP - By Marco Russo - SQLBI
Customer Analysis BISM Tabular Query in DAX is fast enough Good to get number and also to extract customers list Extraction logic in DAX, not in ETL Easy to change No special ETL and data modeling required Just because distinct count is fast * Vertipaq vs OLAP - By Marco Russo - SQLBI
Customer Analysis DAX Query Heavily Use DistinctCount without Performance Issues NewCustomers := CALCULATE( DISTINCTCOUNT( FactInternetSales[CustomerKey] ), ) FILTER( ALL( DimTime ), ) - CALCULATE( DimTime[TimeKey] <= MAX( DimTime[TimeKey] ) DISTINCTCOUNT( FactInternetSales[CustomerKey] ), FILTER( ALL( DimTime ), * Vertipaq vs OLAP - By Marco Russo - SQLBI ) ) DimTime[TimeKey] < MIN( DimTime[TimeKey] )
In Summary, in Tabular Mode you can Query data using relationships that are not defined in the data model as regular relationships You can extend the data model without reprocessing the whole database using calculated columns Flexibility = Faster response to scenario changes! Tasting the Flavors of SSAS 2012 SQL Saturday Puerto Rico Alan Koo www.alankoo.com
Thoughts What have We Learned Today Tabular is not and upgrade to OLAP Evaluate user and data requirements before choosing SSAS mode For tabular: Consider alternative models for DW design Learn DAX Master DAX Consider BISM Tabular side by side with Multidimensional Specific models can be better solved by BISM Tasting the Flavors of SSAS 2012 SQL Saturday Puerto Rico Alan Koo www.alankoo.com
References Ashvini Sharma (Microsoft) presentation at TechEd 2011 Marco Russo (SQLBI) presentation at PASS 2011 Comparing Tabular and Multidimensional Solutions (SSAS) MSDN Tabular Modeling (Adventure Works Tutorial) MSDN Melissa Coates - Decisions: PowerPivot, SSAS Tabular, or SSAS Multidimensional Model in SQL Server 2012 Tasting the Flavors of SSAS 2012 SQL Saturday Puerto Rico Alan Koo www.alankoo.com
Q & A Tasting the Flavors of SSAS 2012 SQL Saturday Puerto Rico Alan Koo www.alankoo.com
Platinum Sponsors: Gold Sponsors: Silver Sponsors: Bronze Sponsors: Swag Sponsors: