OLAP – Creating Cubes with SQL Server Analysis Services

49
SQL Server 2008 for Business Intelligence UTS Short Course

description

What is a Cube? Steps in Creating a Cube Demo: Creating a Cube Cube Issues Hands on Lab

Transcript of OLAP – Creating Cubes with SQL Server Analysis Services

Page 1: OLAP – Creating Cubes with SQL Server Analysis Services

SQL Server 2008 for Business Intelligence UTS Short Course

Page 2: OLAP – Creating Cubes with SQL Server Analysis Services

Step to the next level!

From Microsoft and the founders of Scrum (Ken Schwaber)

Innovative

For developers

Learn

Modern engineering practices

Visual Studio 2010 and Team Foundation Server

Scrum framework

Assessments and certifications are available

Find a local class

http://go.microsoft.com/fwlink/?LinkId=187778

Page 3: OLAP – Creating Cubes with SQL Server Analysis Services

Specializes in

C# and .NET (Java not anymore)

Testing Automated tests

Agile, Scrum Certified Scrum Trainer

Technology aficionado • Silverlight

• ASP.NET

• Windows Forms

Peter Gfader

Page 4: OLAP – Creating Cubes with SQL Server Analysis Services

Course Timetable & Materials

http://www.ssw.com.au/ssw/Events/2010UTSSQL/

Resources

http://sharepoint.ssw.com.au/Training/UTSSQL/

Course Website

Page 5: OLAP – Creating Cubes with SQL Server Analysis Services

Course Overview

Session Date Time Topic

1 Tuesday

14-09-2010 18:00 - 21:00 SSIS and Creating a Data Warehouse

2 Tuesday

21-09-2010

18:00 -

21:00 OLAP – Creating Cubes and Cube Issues

3 Tuesday

28-09-2010 18:00 - 21:00 Reporting Services

4 Tuesday

05-10-2010 18:00 - 21:00 Alternative Cube Browsers

5 Tuesday

12-10-2010 18:00 - 21:00 Data Mining

Page 6: OLAP – Creating Cubes with SQL Server Analysis Services

Business Intelligence

Data Warehouse

Measure (Facts)

Dimension

ETL

SSIS

Last week

Page 7: OLAP – Creating Cubes with SQL Server Analysis Services

What is a "TYPE"?

Why?

DWCreateScript.sql:

What does the stored procedure "procDimDateInsert" do?

What is the difference

TRUNCATE

DELETE FROM?

SSIS: What for is the Sequence Container?

Homework

Page 8: OLAP – Creating Cubes with SQL Server Analysis Services

Cubes

Page 9: OLAP – Creating Cubes with SQL Server Analysis Services

1. What is a Cube?

2. Steps in Creating a Cube

3. Demo: Creating a Cube

4. Cube Issues

5. Hands on Lab

Session 2: Tonight’s Agenda

Page 10: OLAP – Creating Cubes with SQL Server Analysis Services

Cubes

Page 11: OLAP – Creating Cubes with SQL Server Analysis Services

Data structure for fast analysis of data

Precalculated

On top of a data warehouse

Manipulating and analysing data

from multiple perspectives

Cube

Page 12: OLAP – Creating Cubes with SQL Server Analysis Services

Performance

Relational databases not suited for instantaneous analysis

Cube precalculates (aggregates) data

Why a cube?

Page 13: OLAP – Creating Cubes with SQL Server Analysis Services

Cube Concept

Product

Geog

Time Q1 Q2 Q3 Q4

Clothing

Electronics

Groceries

Garden

Automotive

North

South

East

West

Page 14: OLAP – Creating Cubes with SQL Server Analysis Services

Edges are Dimensions

West

East

South

North

Page 15: OLAP – Creating Cubes with SQL Server Analysis Services

North

Q4

Groceries

Page 16: OLAP – Creating Cubes with SQL Server Analysis Services

„Import“ cube example

Sum over Packages

Max over Last

Page 17: OLAP – Creating Cubes with SQL Server Analysis Services

Aggregate measures over time dimension

Attribute hierarchy

Page 18: OLAP – Creating Cubes with SQL Server Analysis Services

Aggregate measures by multi dimensions

Packages Last

All

Sources Eastern

Hemisphere

Western

Hemisph.

All

Sources Eastern

Hemisph.

Western

Hemisph.

All

Time 25110 6547 18563 Dec-29-99 Dec-22-99 Dec-29-99

1st

half 11173 2977 8196 Jun-28-99 Jun-20-99 Jun-28-99

1st

quarter 5108 1452 3656 Mar-30-99 Mar-19-99 Mar-30-99

2nd

quarter 6065 1525 4540 Jun-28-99 Jun-20-99 Jun-28-99

.

.

.

.

Page 19: OLAP – Creating Cubes with SQL Server Analysis Services

Performance

Relational databases not suited for instantaneous analysis

Cube precalculates (aggregates) data

KPI and trending

Why a cube?

Page 20: OLAP – Creating Cubes with SQL Server Analysis Services

A cube is an

“aggregation of measures

against dimensions”

Adventure Works example

Page 21: OLAP – Creating Cubes with SQL Server Analysis Services

What is a Cube - Example

Page 22: OLAP – Creating Cubes with SQL Server Analysis Services

What is a Cube - Example

Page 23: OLAP – Creating Cubes with SQL Server Analysis Services

1. Data Source

Where the data comes from • Adventure works connection string

2. Data Source View

The tables and how they link together • Orders, Details, Products and relationships • Name matching to detect relationships

3. Dimensions

How we break up the aggregate data • Products, Time

4. Measures (Facts)

The aggregate data • Line Total, Quantity

What is a Cube in SQL 2005/2008

Page 24: OLAP – Creating Cubes with SQL Server Analysis Services

1. Define Data Source

2. Create Data Source View

3. Define Dimensions

4. Define Measures (Facts)

5. Process the Cube

Steps in Creating a Cube

Page 25: OLAP – Creating Cubes with SQL Server Analysis Services

Data Source - Database

Page 26: OLAP – Creating Cubes with SQL Server Analysis Services

Data Source - Impersonation (Authentication)

Page 27: OLAP – Creating Cubes with SQL Server Analysis Services

Data Source View – Data Source

Page 28: OLAP – Creating Cubes with SQL Server Analysis Services

Data Source View – Connect Tables (Name

Matching)

Page 29: OLAP – Creating Cubes with SQL Server Analysis Services

Data Source View – Select Tables and Views

Page 30: OLAP – Creating Cubes with SQL Server Analysis Services

Manually adjust relationships missed by the wizard

Data Source View

Page 31: OLAP – Creating Cubes with SQL Server Analysis Services

Build a Cube – Build Method

Page 32: OLAP – Creating Cubes with SQL Server Analysis Services

Build a Cube – Select a Data Source View

Page 33: OLAP – Creating Cubes with SQL Server Analysis Services

Build a Cube – Select Measures

Page 34: OLAP – Creating Cubes with SQL Server Analysis Services

Build a Cube – Select Dimension

Page 35: OLAP – Creating Cubes with SQL Server Analysis Services

Build a Cube - Select Time Periods

Page 36: OLAP – Creating Cubes with SQL Server Analysis Services

Build a Cube – Process Cube

Page 37: OLAP – Creating Cubes with SQL Server Analysis Services

Build a Cube – Process Cube

Page 38: OLAP – Creating Cubes with SQL Server Analysis Services

Review Auto Generated Cube

Check Hierarchies e.g. Product Category shows ID rather than

name

Build a Cube

Page 39: OLAP – Creating Cubes with SQL Server Analysis Services

Build a Cube – Fix Dimensions

Page 40: OLAP – Creating Cubes with SQL Server Analysis Services

Keeping things Related Dimensions should tie in to Fact tables Use Primary Keys

Keeping things Relevant Multiple fact tables Even more dimensions

Keeping things Fresh Needs to be processed Automated SSIS Packages

Keeping Missing Data Fails to process when keys are missing Change missing keys to Unknown

Cube Issues

Page 41: OLAP – Creating Cubes with SQL Server Analysis Services

That's a Cube!

Page 42: OLAP – Creating Cubes with SQL Server Analysis Services

1. What is a Cube?

2. Steps in Creating a Cube

3. Demo: Creating a Cube

4. Cube Issues

5. Hands on Lab

Summary

Page 44: OLAP – Creating Cubes with SQL Server Analysis Services

http://channel9.msdn.com/tags/Data+Warehousing/

http://channel9.msdn.com/tags/Business+Intelligence/

http://blog.sqlauthority.com/2007/07/29/sql-server-data-

warehousing-interview-questions-and-answers-complete-list-

download/

Tips

Page 46: OLAP – Creating Cubes with SQL Server Analysis Services

Newsletter

http://www.sqlservercentral.com/

BIDS helper

http://www.codeplex.com/bidshelper

Resources

Page 47: OLAP – Creating Cubes with SQL Server Analysis Services

Step to the next level!

From Microsoft and the founders of Scrum (Ken Schwaber)

Innovative

For developers

Learn

Modern engineering practices

Visual Studio 2010 and Team Foundation Server

Scrum framework

Assessments and certifications are available

Find a local class

http://go.microsoft.com/fwlink/?LinkId=187778

Page 48: OLAP – Creating Cubes with SQL Server Analysis Services

3 things…

[email protected]

http://blog.gfader.com/

twitter.com/peitor

Page 49: OLAP – Creating Cubes with SQL Server Analysis Services

Thank You!

Gateway Court Suite 10

81 - 91 Military Road

Neutral Bay, Sydney NSW 2089

AUSTRALIA

ABN: 21 069 371 900

Phone: + 61 2 9953 3000

Fax: + 61 2 9953 3105

[email protected]

www.ssw.com.au