100
Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: [email protected] E2: [email protected]

Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: [email protected]@gmail.com

Embed Size (px)

Citation preview

Page 1: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

Business Intelligence Portfolio

SetFocus Business Intelligence Master’s Program

Jeff Jacob, MBA

P: (312) 772-6142E1: [email protected]: [email protected]

Page 2: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

Table of Contents

• What is Set Focus?• Bio: Jeff Jacob• Transact-SQL Project (Slide 5)

– September, 2010• SSIS /ETL Project (Slide 17)

– October-November, 2010• SSAS OLAP Cube Project (Slide 42)

– January, 2011– MDX Supplement (Slide 61)

• SSRS – PerformancePoint – Excel Services (MOSS 2007 publishing) Project (Slide 69)– March, 2011

2

Page 3: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

What is Set Focus?

3

• The SetFocus Business Intelligence Master’s Program is an intensive, hands–on, project-oriented program providing knowledge and experience in putting the BI skill set to use in a simulated work environment.

• I have received over 400 hours of in-depth, hands-on experience - focused on the Microsoft Business Intelligence stack; equivalent to about 1 - 1.5 years of experience.

• SetFocus projects are real world projects that are distributed just as I would receive in a BI position. I received project specifications and was expected to identify best courses of action - with deadlines set for completion. What follows is a sample of what I can do using the MS BI stack tools.

Page 4: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

5+ years experience in quantitative analytics, project management, marketing strategy(corporate HQ level)

4+ years experience in client-facing editing and translation consulting

1997: B.A. German, Philosophy (magna cum laude) 3.7 (out of 4.0) cumulative GPA

2009: M.B.A. - Accounting concentration (with distinction) 3.9 (out of 4.0) cumulative GPA

Career objective: BI Analyst/Developer

Relevant Business Interests: Accounting/Finance, Economics, Statistics, Marketing, Strategy

Bio: Jeff Jacob

4

Page 5: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

Transact-SQL ProjectSQL Server 2008 Management Studio

SetFocus Business Intelligence Master’s Program

Jeff Jacob, MBAP: (312) 772-6142E1: [email protected]: [email protected]

TOC

Page 6: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

Query – Wildcard Search (CI Collation)

A summary of order detail-line total by product – for products that contain ‘Washer’ in their name; 2003 data only.

USE [AdventureWorks2008];GO

SELECT Name, SUM(LineTotal) AS TotDollars FROM Purchasing.PurchaseOrderDetail pod INNER JOIN Purchasing.PurchaseOrderHeader poh ON poh.PurchaseOrderID = pod.PurchaseOrderID INNER JOIN Production.Product prd ON prd.ProductID = pod.ProductID WHERE Name LIKE '%washer%‘ AND YEAR(OrderDate) = 2003 GROUP BY Name

ORDER BY TotDollars DESC

6

Page 7: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

7

Query – HAVING clause

A count of orders by product subcategory– for those with at least 10 orders; 2004 data only.

USE [AdventureWorks2008];GO

SELECT psc.Name, COUNT(poh.PurchaseOrderID) AS NumOrders FROM Purchasing.PurchaseOrderHeader poh INNER JOIN Purchasing.PurchaseOrderDetail pod ON pod.PurchaseOrderID =

poh.PurchaseOrderID INNER JOIN Production.Product prd ON prd.ProductID = pod.ProductID INNER JOIN Production.ProductSubcategory psc ON prd.ProductSubcategoryID =

psc.ProductSubcategoryID WHERE YEAR(OrderDate) = 2004

GROUP BY psc.Name HAVING COUNT(poh.PurchaseOrderID) >=10 ORDER BY NumOrders DESC

Page 8: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

8

Query – Correlated Subquery of exclusion

A list of the vendors for which there were no orders in 2003.

USE [AdventureWorks2008];GO

SELECT Name FROM Purchasing.Vendor WHERE NOT EXISTS

(SELECT * FROM Purchasing.PurchaseOrderHeader WHERE YEAR(OrderDate) = 2003 AND Vendor.BusinessEntityID = PurchaseOrderHeader.VendorID)

Page 9: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

9

Query – OUTER JOIN syntax

A summary of freight charges by shipper for all shippers; Q1 of 2003 data only.

USE [AdventureWorks2008];GO

SELECT Name, SUM(Freight) AS TotFreight FROM Purchasing.ShipMethod sm LEFT OUTER JOIN Purchasing.PurchaseOrderHeader poh ON poh.ShipMethodID = sm.ShipMethodID AND YEAR(OrderDate) = 2003 AND DATEPART(q,OrderDate) = 1 GROUP BY Name ORDER BY TotFreight DESC

Page 10: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

10

Query – Chronological Sort

USE [AdventureWorks2008];GO

SELECT NationalIDNumber, LoginID, DATENAME(MONTH, OrderDate) AS MonthName, YEAR(OrderDate) as YearName, SUM(TotalDue) AS SumTotalDue FROM Purchasing.PurchaseOrderHeader poh INNER JOIN HumanResources.Employee emp ON emp.BusinessEntityID

= poh.EmployeeID WHERE NationalIDNumber IN (792847334, 407505660, 482810518,

466142721, 367453993) AND YEAR(OrderDate) = 2003 GROUP BY NationalIDNumber, LoginID, DATENAME(MONTH, OrderDate),DATEPART(MONTH, OrderDate) ,YEAR(OrderDate) ORDER BY NationalIDNumber, DATEPART(MONTH, OrderDate)

A summary of total charges due by specific employee national ID numbers, sorted chronologically within each employee; 2003 data only.

Page 11: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

11

Query – UNION query

A union of two view-based queries to obtain contact information of both vendors and employees, sorted first by postal code and then by name.

USE [AdventureWorks2008];GO

SELECT 'Vendor' AS RecordType, Name, AddressLine1, ISNULL(AddressLine2,'') AS AddressLine2, City, StateProvinceName, PostalCode FROM Purchasing.vVendorWithAddresses

UNION ALL

SELECT 'Employee' AS RecordType, LastName + ', ‘ + FirstName + ' ‘ + ISNULL(MiddleName, ''), AddressLine1, ISNULL (AddressLine2,''), City, StateProvinceName, PostalCode FROM HumanResources.vEmployee ORDER BY PostalCode, Name

Page 12: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

12

Query – Stored Procedure

A stored procedure designed to summarize freight, tax amount and subtotal by vendor and shipper based on supplied account number and date parameters; with example usage.

USE [AdventureWorks2008];GO

CREATE PROCEDURE dbo.usp_GetVendorOrders@AcctNo nvarchar(15), @StartDate datetime, @EndDate datetime

ASSET NOCOUNT ON;

SELECT Ven.Name AS VendorName, Ship.Name AS ShipperName, SUM(Freight) as TotFreight, SUM(TaxAmt) AS TotTaxAmt, SUM(SubTotal) AS TotSubTot FROM Purchasing.PurchaseOrderHeader poh JOIN Purchasing.Vendor Ven ON poh.VendorID = Ven.BusinessEntityID JOIN Purchasing.ShipMethod ship ON ship.ShipMethodID = poh.ShipMethodID WHERE OrderDate >= @StartDate and OrderDate <= @EndDate AND AccountNumber = @AcctNo

GROUP BY Ven.Name, Ship.NameGO

EXEC dbo.usp_GetVendorOrders N'ADVANCED0001', '1-1-2003', '12-31-2003'

Page 13: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

13

Query – PIVOT table

A pivot table of shipper data for total charges due in 2003 summarized by Saturdays with a summary rank of the Top 5 based on grand total.

;WITH ShipperTotDueCTE AS (SELECT sm.Name, dbo.SatDatesConverter(OrderDate) AS WeekEnding, TotalDue FROM Purchasing.PurchaseOrderHeader poh INNER JOIN Purchasing.ShipMethod sm ON sm.ShipMethodID = poh.ShipMethodID WHERE YEAR(OrderDate) = 2003 ),

SumByWeekEndCTE AS (SELECT Name AS Shipper, WeekEnding, SUM(TotalDue) AS GrandTot FROM ShipperTotDueCTE GROUP BY Name, WeekEnding ),

PivCTE AS (SELECT WeekEnding, [XRQ - Truck Ground] AS XRQ, [Cargo Transport 5] AS Cargo, [Overnight J-Fast] AS Overnight, [ZY - Express] AS ZY, [Overseas - Deluxe] AS Overseas, ISNULL([XRQ - Truck Ground],0) + ISNULL([Cargo Transport 5],0) + ISNULL([Overnight J-Fast],0) + ISNULL([ZY - Express],0) + ISNULL([Overseas - Deluxe],0) AS GrandTot FROM SumByWeekEndCTEPIVOT ( SUM(GrandTot) FOR Shipper IN ([XRQ - Truck Ground],[Cargo Transport 5], [Overnight J-Fast],[ZY - Express], [Overseas - Deluxe]) ) AS P )

SELECT TOP 5 WeekEnding, GrandTot, RANK() OVER (ORDER BY GrandTot DESC) AS WeekRank, XRQ, ZY, Overseas, Overnight, Cargo FROM PivCTE ORDER BY WeekRank;

USE [AdventureWorks2008];GO

CREATE FUNCTION [dbo].[SatDatesConverter](@orderdate datetime)

RETURNS datetimeASBEGINDECLARE @satdate datetimeSET @satdate = (SELECT DateAdd(d, 7- datepart(dw, @OrderDate), @OrderDate)) RETURN @satdateEND;

GO

Page 14: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

14

Query – SP, CTE-only approach

A stored procedure for a ranking of Top N vendors by Total Due amount; and, within each vendor, the Top N products based on Line Total (Due) for specified start/end dates.

USE [AdventureWorks2008];GO

CREATE PROCEDURE dbo.usp_VendorProductRank@TopN int, @TopY int, @BeginDate datetime, @EndDate datetimeAS SET NOCOUNT ON;

;WITH VendCTE AS (SELECT Ven.BusinessEntityID, Ven.Name AS VendorName, SUM(TotalDue) AS TotalDue, DENSE_RANK () OVER (ORDER BY SUM(TotalDue) DESC ) AS VendorRank FROM Purchasing.Vendor Ven INNER JOIN Purchasing.PurchaseOrderHeader poh ON poh.VendorID = Ven.BusinessEntityID WHERE OrderDate >= @BeginDate AND OrderDate <= @EndDate GROUP BY BusinessEntityID, Name ),ProdCTE AS (SELECT Ven.BusinessEntityID, prd.Name AS ProductName, SUM(LineTotal) AS ProductTotalDue, DENSE_RANK() OVER (PARTITION BY Ven.BusinessEntityID ORDER BY SUM(LineTotal) DESC) AS ProductRankFROM Purchasing.Vendor venINNER JOIN Purchasing.PurchaseOrderHeader poh ON poh.VendorID = ven.BusinessEntityIDINNER JOIN Purchasing.PurchaseOrderDetail pod ON pod.PurchaseOrderID = poh.PurchaseOrderIDINNER JOIN Production.Product prd ON prd.ProductID = pod.ProductIDWHERE OrderDate >= @BeginDate AND OrderDate <= @EndDateGROUP BY Ven.BusinessEntityID, prd.Name)

SELECT VC.VendorName, VC.VendorRank, CAST(VC.TotalDue AS NUMERIC (14,2)) AS TotalDue, PC.ProductName, PC.ProductRank, CAST(PC.ProductTotalDue AS NUMERIC (14,2) ) AS ProductTotalDue FROM VendCTE VC INNER JOIN ProdCTE PC ON PC.BusinessEntityID = VC.BusinessEntityIDWHERE VendorRank <= @TopN AND ProductRank <= @TopYORDER BY VendorRank, ProductRank

GO

EXEC dbo.usp_VendorProductRank 5,5,'2003-01-01', '2004-06-30'

Page 15: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

15

Query – SP, CTE/Function approach

A stored procedure for a ranking of Top N vendors by Total Due amount; and, within each vendor, the Top N products based on Line Total (Due) for specified start/end dates.

CREATE PROCEDURE dbo.usp_TestProc1@TopN int, @TopY int, @BeginDate datetime, @EndDate datetimeASSET NOCOUNT ON;

;WITH xCTE as ( SELECT TOP (@TopN) WITH TIES poh.VendorID, ven.Name AS VendorName, SUM(poh.TotalDue) AS TotalDue, DENSE_RANK() OVER (ORDER BY SUM(poh.TotalDue) DESC) AS VendorRank FROM Purchasing.PurchaseOrderHeader poh INNER JOIN Purchasing.Vendor ven ON ven.BusinessEntityID = poh.VendorID WHERE OrderDate >= @BeginDate AND OrderDate <= @EndDate GROUP BY poh.VendorID, ven.Name )

SELECT xCTE.VendorName, xCTE.VendorRank, CAST(xCTE.TotalDue AS NUMERIC (14,2)) AS TotalDue, C.ProductName, C.ProductRank, CAST(C.ProductLineTotal AS NUMERIC (14,2) ) AS ProductLineTotal FROM xCTE CROSS APPLY dbo.TestFn1 (xCTE.VendorID, @TopY, @BeginDate, @EndDate) AS C GO

EXEC dbo.usp_TestProc1 5, 5,'2003-01-01', '2004-06-30'

USE [AdventureWorks2008];GO

CREATE FUNCTION dbo.TestFn1(@VendorID int, @TopY int, @StartDate datetime, @EndingDate datetime)RETURNS TABLEAS RETURN SELECT TOP (@TopY) WITH TIES poh.vendorid, prd.Name AS ProductName, DENSE_RANK() OVER (PARTITION BY poh.vendorID ORDER BY SUM(pod.LineTotal) DESC) AS ProductRank, SUM(pod.LineTotal) AS ProductLineTotal FROM Production.Product prd INNER JOIN Purchasing.PurchaseOrderDetail pod ON pod.productid = prd.productid INNER JOIN Purchasing.PurchaseOrderHeader poh

ON pod.PurchaseOrderid = poh.purchaseorderid WHERE poh.VendorID = @VendorID AND OrderDate >= @StartDate

AND OrderDate <= @EndingDate GROUP BY poh.vendorID, prd.Name ORDER BY ProductLineTotal DESCGO

Page 16: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

16

Query – Effective (‘As of’) Dates: Scalar UDF

USE [AdventureWorks2008];GO

CREATE FUNCTION dbo.ProdStdCostAsOfDate(@ProductID int, @AsOfDate datetime )RETURNS MONEYASBEGINDECLARE @StndCost moneySET @StndCost = ( SELECT StandardCost FROM Production.ProductCostHistory pch WHERE ProductID = @ProductID AND StartDate = (SELECT MAX(StartDate) FROM Production.ProductCostHistory

WHERE ProductID = @Productid AND StartDate <= @AsOfDate ) )

RETURN @StndCostEND;

GO

;WITH ProdStdCostCTE AS (SELECT ProductNumber, Name, CAST( dbo.ProdStdCostAsOfDate (Product.ProductID, '2002-01-01') AS NUMERIC (14,2) ) AS StandardCostFROM Production.Product INNER JOIN Production.ProductCostHistory pch ON pch.ProductID = Product.ProductID )

SELECT ProductNumber, Name, StandardCost FROM ProdStdCostCTE WHERE StandardCost IS NOT NULL AND StandardCost > 700 ORDER BY StandardCost DESC;

A function which provides the commensurate standard product cost based on a specified productID number and a desired ‘effective date.’ Example included.

Page 17: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

SSIS/ETL ProjectSQL Server Integration Services (BIDS) 2008

SetFocus Business Intelligence Master’s Program

Jeff Jacob, MBA

P: (312) 772-6142E1: [email protected]: [email protected]

TOC

Page 18: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

SSIS/ETL Project: AllWorks, Inc.Documentation

Objectives:

• Based on source data, design a 3NF database for AllWorks, Inc.

• Create the database, tables, and constraints in T-SQL

• Develop a SSIS Project file with ETL packages to bring data from

source files into the AllWorksOLTP database; use a master package

to run the ETL packages in proper succession and to effectuate

database maintenance tasks

• Deploy the SSIS Project file to SQL Server and schedule the job

to run nightly at midnight

Page 19: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

19

1. Consider the details of the source data.

Page 20: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

20

2. Design a relational (3NF) database. * note: LaborMaster name chosen because table contains data about both employees and contractors.

NOT USED

Page 21: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

21

3. Script the creation of the relational (3NF) database AllWorksOLTP and its tables.

USE [master]GO

IF EXISTS (SELECT name FROM sys.databases WHERE name = N'AllWorksOLTP')DROP DATABASE [AllWorksOLTP]GO

CREATE DATABASE AllWorksOLTP;

USE AllWorksOLTP;GO

Create Table dbo.CountyMaster (CountyPK int primary key clustered,CountyDescription varchar(100) not null);

Create Table dbo.ClientMaster (ClientPK int primary key clustered,ClientName varchar(100) not null,ProjectManager varchar(100) not null,City varchar(100) not null,[State] char(2) not null,ZipCode varchar(50) not null,CountyPK int not null,ClientImage varchar(150),Constraint FK_CustMaster_CountyMaster Foreign Key (CountyPK) References dbo.CountyMaster (CountyPK) );

Create Table dbo.JobMaster (JobPK int primary key clustered ,JobDescription varchar(50) ,ClientPK int not null,MaterialMarkupPct decimal (10,2) ,AdditionalOverheadPct decimal (10,2) ,JobClosedFlag bit not null ,JobClosedDate datetime ,JobStartedDate datetime,Constraint FK_JobMast_ClientMast Foreign Key (ClientPK) References dbo.ClientMaster (ClientPK));

SAMPLE ONLY

Page 22: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

22

SSMS Database Diagram: AllWorksOLTP Database

Page 23: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

23

SSIS Project File (SSISStudentProject.JeffJacob.sln) details of common variables, source files and error log files:

Common Variables for ETL Packages - SSIS project:

Run-time VariableschangedRowCounter (rows updated)newRowCounter (rows inserted)errorRowCounter (FK-violating rows written to error log)unchangedRowCounter (redundant/unused rows)

Configuration VariablesVariable Name Default (debugging) ValueDBServer localhostsmtpServer sfexch0003 EmailRecipient [email protected]

SOURCE FILES:TimeSheetFiles (Pkg: TimeSheets [uses CSV files])

• EmpTime*.csvEmployeeExcelSourceFile (Pkgs: EmployeeMaster, EmployeeRates)

• Employees.xlsxOverheadExcelSourceFile (Pkgs: OverheadMaster, OverheadRates)

• Overhead.xlsxClientGeographiesExcelSourceFile (Pkgs: CountyMaster, ClientMaster)

• ClientGeographies.xlsxProjectMasterExcelSourceFile (Pkg: JobMaster)

• ProjectMaster.xlsxMaterialPurchasesSourceFile [uses XML file] (Pkg: Material Purchases)

• MaterialPurchases.xml / .xsd (no Connection Variable)InvoicesExcelSourceFile (Pkgs: Invoices, InvoiceXJobMaster, InvoiceReceipts)

• Invoices.xlsx

ERROR LOG FILES:(None - no FKs) (Pkgs: EmployeeMaster, OverheadMaster, CountyMaster)

• no FK violations possibleEmployeeRatesErrorLogFile (Pkg: EmployeeRates)

• EmployeeRatesErrorLog.txtOverheadRatesErrorLogFile (Pkg: OverheadRates)

• OverheadRatesErrorLog.txtClientMasterErrorLogFile (Pkg: ClientMaster)

• ClientMasterErrorLog.txtJobMasterErrorLogFile (Pkg: JobMaster)

• JobMasterErrorLog.txtTimeSheetsErrorLogFile (Pkg: TimeSheets)

• TimeSheetsErrorLog.txtMaterialPurchasesErrorLogFile (Pkg: MaterialPurchases)

• MaterialPurchasesErrorLog.txtInvoiceErrorLogFile (Pkg: Invoices)

• InvoicesErrorLog.txtInvoiceXJobMasterErrorLogFile (Pkg: InvoiceXJobMaster)

• InvoicesXJobMasterErrorLog.txtInvoiceReceiptsErrorLogFile (Pkg: InvoiceReceipts)

• InvoiceReceiptsErrorLog.txt

Page 24: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

24

SSIS Project File (SSISStudentProject.JeffJacob.sln) details on project naming convention (ETL packages only):

Project Naming Convention– Control Flow and Data Flow Objects:

ETL Package Names<Function/Target Table> DataLoad (.dtsx)

ETL Control Flow Objects

Object Type NameData Flow Task Read <data description> into (AllWorksOLTP) DBSend Mail Task Email successful (unsuccessful) ETL processing of <DB target table>Script Task Collect count of items processed (TimeSheetsDataLoad ETL package only)File System Task Delete Error File From File System (TimeSheetsDataLoad ETL package only)Foreach Loop Container Loop through TimeSheet data source files (TimeSheetsDataLoad ETL package only)

ETL Data Flow Objects Object Type NameExcel Source Get Excel source dataFlat File Source Get TimeSheet CSV filesXML Source Get Material Purchases dataData Conversion Convert data to DB-compatible data typesLookup Transformation (FKs) Validate incoming FK values against <parent table>Lookup Transformation (PKs) Validate incoming PK values against <parent table>Conditional Split (update check) Split out real update rows from redundant rowsConditional Split (error split) Remove errors from main pipelineRow Count Transformation (new) Count new rowsRow Count Transformation (changed) Count changed rowsRow Count Transformation (unchanged) Count unchanged rowsRow Count Transformation (errors) Count error rowsOLE DB Destination Insert new rowsAudit Transformation Add Processing-info audit trail fields - package name and time of processingOLE DB Command Transformation Update <Target Table> dataFlat File Destination Send errors to error logDerived Column Transformation (No naming convention – named according to usage)

Page 25: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

25

SSIS Project File (SSISStudentProject.JeffJacob.sln) additional details on project naming convention (ETL packages only):

Project Naming Convention– Data Flow columns :

Data Conversion Field Lookup Column Field Derived Table FieldTransformed<source field name> Target<source field name> (purpose-dependent: no naming convention)

Samples of Data Conversion, Lookup and Derived Column Transformations in project:

Page 26: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

26

Sample of Email Task customization

Page 27: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

27

Sample of Lookup task to check for Foreign Key violating data rows; such rows are errors and are counted and sent to an error file (below).

Page 28: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

28

Sample of Lookup task to check Primary Key values in incoming data rows; new Primary Key values are new rows to be inserted and pre-existing Primary Key values are update candidates which are checked for redundancy; inserts and updates are split, counted and sent for DB Insert/Update commands respectively.

Page 29: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

29

Overview of LaborMaster ETL package data flow

Page 30: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

30

Overview of CountyMaster ETL package data flow

Page 31: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

31

Overview of JobMaster ETL package data flow

Page 32: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

32

C# script to enable file and row count totals:

MaterialPurchases data ETL package: Control Flow and Variables

Page 33: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

33

Overview of TimeSheets ETL package data flow

Page 34: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

34

Invoices data ETL package: Control Flow and VariablesSource of ClientPK data:

Page 35: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

35

Overview of Invoices ETL package data flow

Page 36: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

36

ALL ETL Packages are configured with these parent package variables

Page 37: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

37

Overview of the Master Package

Page 38: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

38

Sequence Container detail view

Page 39: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

39

Project deployment to SQL Server

SSMS view of deployed project:

Page 40: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

40

Setting up a SQL Agent Job to execute the AllWorks OLTP master package every night at midnight.

Page 41: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

41

Confirmation of successful Agent job / project execution

Page 42: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

OLAP Cube ProjectSQL Server Analysis Services (BIDS) 2008

SetFocus Business Intelligence Master’s Program

Jeff Jacob, MBA

P: (312) 772-6142E1: [email protected]: [email protected]

TOC

Page 43: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

43

• Enhance a relational data warehouse with a fact and dimension table structure (preparing the ‘staging area’) for AllWorks• Create and define an OLAP cube according to end-user specifications using the enhanced data warehouse as the staging area data source• Relate dimensions in accordance with PK-FK relationships• Surface attributes and build hierarchies in dimensions• Define calculated members and dynamic named sets according to end-user

specifications (MDX)• Implement a Standard Action allowing end-users to view Bing maps of the respective

county (dimensional attribute)• Create MOLAP partitions for each fact table

• an archive partition for all data prior to June 16, 2005 • an active partition for all data on or after June 16, 2005 • develop MOLAP aggregations for a 50% retrieval performance increase

• Design cube perspectives around measure groups for end-user ease• Define KPIs to provide additional, useful data viewing (MDX)• Document the OLAP Project (this slide-deck)

Project Objectives

Page 44: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

44

Fact and Dimension Table Structure

USE [AllWorksDW]GO

IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SatDatesConverter]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))DROP FUNCTION [dbo].[SatDatesConverter]GO

SET ANSI_NULLS ONGO

SET QUOTED_IDENTIFIER ONGO

CREATE FUNCTION [dbo].[SatDatesConverter](@orderdate datetime)

RETURNS datetimeASBEGINDECLARE @satdate datetimeSET @satdate = (SELECT DATEADD(d, 7- DATEPART(dw, @OrderDate), @OrderDate)) RETURN @satdateEND;GO

USE [AllWorksDW]GO

IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[udfGetDateKey]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))DROP FUNCTION [dbo].[udfGetDateKey]GO

SET ANSI_NULLS ONGO

SET QUOTED_IDENTIFIER ONGO

CREATE FUNCTION [dbo].[udfGetDateKey](@entrydate datetime)RETURNS intAS BEGINDECLARE @datekey intSET @datekey = ( SELECT WeekendKey FROM DimDatesWHERE SUBSTRING (DATENAME(mm, dbo.SatDatesConverter(@entryDate)),1,3) +' '+ DATENAME(dd, dbo.SatDatesConverter(@entrydate)) + ', ' + DATENAME(yy, dbo.SatDatesConverter(@entryDate)) = DimDates.WeekendName ) RETURN @datekey END;GO

Scalar functions 1. to covert dates to corresponding Saturdays2. to get a corresponding Date dimension table key value

Page 45: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

45

Fact and Dimension Table Structure

USE [AllWorksDW]GO

IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[udfGetEmpHoursWorkedByProject]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))DROP FUNCTION [dbo].[udfGetEmpHoursWorkedByProject]GO

SET ANSI_NULLS ONGO

SET QUOTED_IDENTIFIER ONGO

CREATE FUNCTION [dbo].[udfGetEmpHoursWorkedByProject](@EmployeePK int, @JobPK int, @workdate datetime)RETURNS decimal(10,2)ASBEGINDECLARE @hours decimal(10,2)SET @hours = (

SELECT HoursWorked FROM JobTimeSheets WHERE EmployeePK = @EmployeePK and JobMasterPK = @JobPK and WorkDate = @WorkDate )

RETURN @hoursEND;

GO

USE [AllWorksDW]GO

IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[udfGetEmployeeRate]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))DROP FUNCTION [dbo].[udfGetEmployeeRate]GO

SET ANSI_NULLS ONGO

SET QUOTED_IDENTIFIER ONGO

CREATE FUNCTION [dbo].[udfGetEmployeeRate](@employeepk int , @workdate datetime )RETURNS decimal(18,2)AS BEGINDECLARE @Rate decimal(18,2)SET @rate = (SELECT hourlyrate FROM EmployeeRates er WHERE EmployeePK = @EmployeePK AND EffectiveDate = (SELECT MAX(effectivedate) FROM EmployeeRates WHERE EmployeePK = @EmployeePK

AND EffectiveDate <= @workdate) )RETURN @rateEND;

GO

Scalar functions 1. to obtain hours worked by an employee on a job2. to get the applicable employee pay rate based on date and ID

Page 46: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

46

Fact and Dimension Table Structure

USE [AllWorksDW]GO

IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[udfGetOHRatesAndPKs]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))DROP FUNCTION [dbo].[udfGetOHRatesAndPKs]GO

SET ANSI_NULLS ONGO

SET QUOTED_IDENTIFIER ONGO

CREATE FUNCTION [dbo].[udfGetOHRatesAndPKs](@workdate datetime, @EmpFlag bit)RETURNS TABLEASRETURNSELECT ohr.OverheadPK, ohr.HourlyRateFROM OverheadRates ohrWHERE (UseEmployeeFlag = 1 AND @empflag = 1

AND EffectiveDate = (SELECT MAX(effectivedate) FROM OverheadRates ohsWHERE EffectiveDate <= @workdate AND UseEmployeeFlag = 1 AND ohs.overheadpk = ohr.overheadpk) )

OR (UseContractorFlag = 1 AND @empflag = 0 AND EffectiveDate = (SELECT MAX(effectivedate) FROM OverheadRates ohx

WHERE EffectiveDate <= @workdate AND UseContractorFlag = 1AND ohx.overheadpk = ohr.overheadpk ) )

GO

Table-valued function1. to obtain the set of Overhead Keys and Rates to apply to ‘hours

worked’ based on the work date and employee flag

Page 47: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

47

Fact and Dimension Table Structure

USE [AllWorksDW]GO

IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_CreateDimDates]') AND type in (N'P', N'PC'))DROP PROCEDURE [dbo].[usp_CreateDimDates]GO

CREATE PROCEDURE [dbo].[usp_CreateDimDates] AS BEGIN

IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DimDates]') AND type in (N'U'))DROP TABLE [dbo].[DimDates]

CREATE TABLE DimDates (WeekendKey int IDENTITY PRIMARY KEY CLUSTERED, WeekEndName varchar(30), QuarterKey int, QuarterName varchar(30), [Year] int)

DECLARE @StartDate Date, @EndDate date

SET @StartDate = '12-27-2003' -- ensures all 2004 weekends includedSET @EndDate = '1-5-2008' --ensures all 2005-2007 weekends included

WHILE @StartDate <= @EndDate BEGIN INSERT INTO DimDates ( WeekEndName, QuarterName, [Year], QuarterKey ) VALUES ( DATENAME(mm, dbo.SatDatesConverter(@StartDate)) +' ' + DATENAME(dd, dbo.SatDatesConverter(@StartDate)) +', ' + DATENAME(yy, dbo.SatDatesConverter(@StartDate)), 'Q' + CAST(DATEPART(qq,@StartDate) AS varchar(1)) + ' ' + CAST(YEAR(@StartDate) as varchar(4)) , YEAR(@StartDate) , DATEPART(qq,@StartDate) ) SET @StartDate = DATEADD(day, 7, @StartDate) END -- end loop END -- close procedure

GO

Stored Procedure – DimDates table1. to create a permanent date dimension table2. to populate the date table with the needed date range

Page 48: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

48

Fact and Dimension Table Structure

USE [AllWorksDW]GO

IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[DimProject]'))DROP VIEW [dbo].[DimProject]GO

CREATE VIEW dbo.DimProjectAS

SELECT JobMasterPK AS ProjectKey, [Description] AS ProjectName, JobMaster.ClientPK AS ClientKey,ClientName AS ClientName, Clients.CountyPK AS CountyKey, CountyName AS CountyName, CASE WHEN jobmaster.JobClosed = 1 THEN dbo.udfGetDateKey(jobmaster.JobClosedDate) ELSE dbo.udfGetDateKey('2004-10-02') END as JobClosedDateKeyFROM JobMasterINNER JOIN Clients ON Clients.ClientPK = JobMaster.ClientPKINNER JOIN County ON County.CountyPK = Clients.CountyPK;

GO

View – DimProject dimension table1. to create a database view with Project data

Page 49: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

49

Fact and Dimension Table Structure

USE [AllWorksDW]GO

IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[FactSummary]'))DROP VIEW [dbo].[FactSummary]GO

CREATE VIEW dbo.FactSummaryAS

SELECT jm.JobMasterPK AS ProjectKey, CAST( SUM( (AdditionalOverheadPct/100) * dbo.udfGetEmployeeRate(jts.EmployeePK, WorkDate) * dbo.udfGetEmpHoursWorkedByProject(jts.EmployeePK, jts.JobMasterPK, WorkDate) ) AS DECIMAL(14,2)) AS LaborProfit,CAST( SUM( (PurchaseAmount) * (MaterialMarkupPct/100) ) AS DECIMAL(14,2)) AS MarkupProfit,(SELECT SUM(AdditionalLabor) FROM InvoiceXJobMaster ixjm WHERE ixjm.JobMasterPK = jm.JobMasterPK) AS AdditionalLaborProfit,(SELECT SUM(InvoiceAmount) FROM InvoiceXJobMaster ixjm WHERE ixjm.JobMasterPK = jm.JobMasterPK) AS InvoiceAmount,(SELECT SUM(AmountPaid) FROM InvoiceReceipts ir WHERE ir.JobMasterPK = jm.JobMasterPK) AS ReceivedAmountFROM JobMaster jmLEFT JOIN JobTimeSheets jts ON jm.JobMasterPK = jts.JobMasterPKLEFT JOIN JobMaterialPurchases jmp ON jmp.JobMasterPK = jm.JobMasterPKGROUP BY jm.JobMasterPK

GO

View – FactSummary fact table1. to create a database view, with summary measures for all

projects/jobs regardless of activity

Page 50: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

50

Fact and Dimension Table Structure

USE [AllWorksDW]GO

IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[FactOverhead]'))DROP VIEW [dbo].[FactOverhead]GO

CREATE VIEW dbo.FactOverheadAS

SELECT ProjectKey, WeekendKey, OverheadType, CAST(SUM(OverheadCost) AS money) AS OverheadCostFROM( SELECT jts.jobmasterpk AS ProjectKey, dbo.udfGetDateKey(jts.workdate) AS WeekendKey, x.overheadpk AS OverheadType, (jts.HoursWorked * x.HourlyRate ) AS OverheadCost FROM JobTimeSheets jts INNER JOIN Employees emp ON emp.employeepk = jts.employeepk CROSS APPLY dbo.udfGetOHRatesAndPKs(jts.WorkDate, Emp.EmployeeFlag) x ) dtGROUP BY ProjectKey, WeekendKey, OverheadType

GO

View – FactOverhead fact table1. to create a database view, only with Overhead measures actually

observed

Page 51: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

51

Fact and Dimension Table Structure

USE [AllWorksDW]GO

IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[FactLabor]'))DROP VIEW [dbo].[FactLabor]GO

SET ANSI_NULLS ONGO

SET QUOTED_IDENTIFIER ONGO

CREATE VIEW dbo.FactLaborAS

SELECT WeekendKey,ProjectKey, EmployeeKey, SUM([Hours]) AS HoursWorked , CAST(SUM(LaborCost) AS money) AS LaborCostFROM ( SELECT dbo.udfGetDateKey(jts.WorkDate) AS WeekendKey, jts.JobMasterPK as ProjectKey, jts.EmployeePK AS EmployeeKey, jts.HoursWorked as [Hours] , jts.HoursWorked * dbo.udfGetEmployeeRate(jts.EmployeePK, Jts.WorkDate) AS LaborCost

FROM JobTimeSheets jts ) dtGROUP BY WeekendKey, EmployeeKey, ProjectKey

GO

View – FactLabor fact table1. to create a database view, only with Labor measures actually

observed

Page 52: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

52

• Primary Key > Foreign Key relationships established in cube’s Data Source View:

• ProjectKey(Dim Project) > ProjectKey(Fact Labor)• ProjectKey(Dim Project) > ProjectKey(Fact Overhead)• ProjectKey(Dim Project) > ProjectKey(Fact Purchase)• ProjectKey(Dim Project) > ProjectKey(Fact Summary)

• WeekendKey(Dim Dates) > WeekendKey(Fact Labor)• WeekendKey(Dim Dates) > WeekendKey(Fact Overhead)• WeekendKey(Dim Dates) > WeekendKey(Fact Purchase) • WeekendKey(Dim Dates) > JobClosedDateKey(Dim Project)

** Snowflake schema for FactSummary (also applied to the remaining fact tables – all through ProjectKey(Dim Project) - JobClosedDateKey functions as role-playing dimension)

• MaterialKey(Dim Material Type) > MaterialKey(Fact Purchase)• OverheadKey(Dim Overhead Type) > OverheadKey(Fact Overhead)• EmployeeID(Dim Employee) > EmployeeKey(Fact Labor)

OLAP Cube: Relating key relationships (bus matrix)

Page 53: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

53

Attributes surfaced/visible in Dimension tables

• Dim Dates• Weekend (WeekEndName) / Quarter (QuarterName) / Year

• Dim Project• ProjectName / ClientName / CountyName

• Dim Employee• EmployeeID (EmployeeKey) / FullName / EmployeeFlag

* EmployeeFlagDescription created as calculated column – serves as display name for EmployeeFlag

• Dim Material Type• Material Type

• Dim Overhead Type• Overhead Type

OLAP Cube: Dimensional attributes and hierarchies

Date Hierarchy Project Hierarchy Employee Hierarchy

YearQuarterWeekend

County NameClient NameProject Name

EmployeeFlagEmployeeKey (FullName)

Page 54: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

54

OLAP Cube: Calculated members

Name Expression Source Object(s)Open Receivables (Currency)

(Invoice Amount – Received Amount) Fact Summary

Open Receivables as Pct of Invoice Amount (Percent)

CASEWHEN [Invoice Amount] = 0 THEN -1ELSE ([Open Receivables]/ [Measures].[Invoice Amount])END

Fact Summary

[Number of Projects - Previous Quarter] (Standard)

([Measures].[Fact Summary Count], [Dim Project - Job Closed Date].[Quarter].CurrentMember.PrevMember)

Fact SummaryDim Project

Change in Number of Projects (Standard)

( [Measures].[Fact Summary Count] - [Number of Projects - Previous Quarter] )

Fact Summary

Total Cost CASE WHEN [Measures].[Labor Cost] + [Measures].[Overhead Cost] + [Measures].[Purchase Cost] = 0Then 0 ELSE [Measures].[Labor Cost] + [Measures].[Overhead Cost] + [Measures].[Purchase Cost] END

Fact LaborFact OverheadFact Purchase

** Calculated members are surfaced in user applications within the Measure Groups area

Page 55: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

55

OLAP Cube: Calculated members

Name (Format) Expression Source Object(s)Overhead Cost as Pct of Total Cost (Percent)

CASEWHEN [Overhead Cost] = 0 THEN 0ELSE [Measures].[Overhead Cost]/ [Total Cost]END

Fact LaborFact OverheadFact Purchase

Total Profit (Currency) ([Measures].[Labor Profit] + [Measures].[Markup Profit] + [Measures].[Additional Labor Profit])

Fact Summary

Profit Percent (Percent) CASE WHEN [Total Cost] = 0 THEN 1 ELSE [Total Profit] / ([Total Profit]+[Total Cost]) END

Fact LaborFact OverheadFact PurchaseFact Summary

Overhead Cost for Previous Quarter (Currency)

([Measures].[Overhead Cost], [Dim Dates].[Date Hierarchy].CurrentMember.PrevMember)

Fact OverheadDim Dates

Overhead Cost Pct Change vs Previous Quarter (Percent)

CASEWHEN [Overhead Cost for Previous Quarter] = 0 THEN 1 ELSE ([Measures].[Overhead Cost]- [Overhead Cost for Previous Quarter]) / [Overhead Cost for Previous Quarter]END

Fact OverheadDim Dates

** Calculated members are surfaced in user applications within the Measure Groups area

Page 56: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

56

OLAP Cube: Standard Action (URL to map counties using Google Maps)

Action Name Target Attribute HierarchyCounty Map [DimProject].[County Name]

"http://maps.google.com/maps?hl=en&q=" +

CASE WHEN[Dim Project].[County Name].CurrentMember.Name = 'Morgan County' THEN 'Greene County'WHEN [Dim Project].[County Name].CurrentMember.Name = 'Madison County'THEN 'Westmoreland County'ELSE [Dim Project].[County Name].CurrentMember.NameEND

+ " PA" + " map"

Calling the CountyMap action in MS Excel

Page 57: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

57

OLAP Cube: Perspectives for focused data users

* Each labeled perspective is shown above• A check mark represents what is included in the perspective; • For each ‘checked’ Measure Group, all measures within that group are

included;• For each ‘checked’ Dimension, all attributes and hierarchies within that

dimension are included• All perspectives include the “CountyMap” Standard Action

Page 58: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

58

OLAP Cube: Key Performance Indicators (KPIs) for decision-support

KPI Name Goal KPI Status Expression Calculated member / expression evaluated

KPI Open Receivables as Pct of Invoice

10% (0.1)

CASE WHEN KPIVALUE("KPI Open Receivables as Pct of Invoice") <= KPIGOAL("KPI Open Receivables as Pct of Invoice") THEN 1 WHEN KPIVALUE("KPI Open Receivables as Pct of Invoice") <= KPIGOAL("KPI Open Receivables as Pct of Invoice")+ 0.1 THEN 0 ELSE -1 END

[Measures].[Open Receivables as Pct of Invoice Amount]

KPI Overhead as Pct of Total

Cost10%(0.1)

CASEWHEN KPIVALUE("KPI Overhead as Pct of Total Cost") <= KPIGOAL("KPI Overhead as Pct of Total Cost") THEN 1WHEN KPIVALUE("KPI Overhead as Pct of Total Cost") <= KPIGOAL("KPI Overhead as Pct of Total Cost")+ .05 THEN 0ELSE -1END

[Measures].[Overhead Cost as Pct of Total Cost]

KPI Profit Pct 15%(0.15)

CASE WHEN KPIVALUE("KPI Profit Pct") > KPIGOAL("KPI Profit Pct") THEN 1 WHEN KPIVALUE("KPI Profit Pct") <= KPIGOAL("KPI Profit Pct") THEN 0 WHEN KPIVALUE("KPI Profit Pct") > KPIGOAL("KPI Profit Pct")-.10 THEN -1 END

[Measures].[Profit Percent]

KPI Overhead Trend

10%(0.1)

CASE WHEN KPIVALUE("KPI Overhead Trend") < KPIGOAL("KPI Overhead Trend") THEN 1 WHEN KPIVALUE("KPI Overhead Trend") <= KPIGOAL("KPI Overhead Trend") + .05 THEN 0 ELSE -1 END

[Measures].[Overhead Cost Pct Change vs Previous Quarter]

Page 59: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

59

OLAP Cube: Key Performance Indicators (KPIs) for decision-support

Page 60: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

60

OLAP Cube: Key Performance Indicators (KPIs) for decision-support

Page 61: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

MDX Supplement to OLAP ProjectSQL Server 2008 Management Studio

SetFocus Business Intelligence Master’s Program

Jeff Jacob, MBAP: (312) 772-6142E1: [email protected]: [email protected]

TOC OLAP

Page 62: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

MDX Query

Retrieving the total cost, total profit, and total profit % - for each job in alphabetical order.

SELECT NON EMPTY{ [Measures].[Total Cost] , [Measures].[Total Profit], [Measures].[Profit Percent]} ON COLUMNS,NON EMPTY [Dim Project].[Project Name].members ON ROWSFROM [Summary Perspective];

62

Page 63: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

MDX Query (using HAVING)

Retrieve Clients in alphabetical order with a Total Labor cost to date greater than $5,000 and the word 'INC' appears in the client name.

SELECT NON EMPTY [Labor Cost] ON COLUMNS,NON EMPTY [Dim Project].[Client Name].[Client Name].members HAVING [labor cost] > 5000 AND INSTR([Dim Project].[Client Name].currentmember.name, 'inc') ON ROWSFROM [Summary Perspective];

63

Page 64: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

MDX Query (using TOPPERCENT)

List the jobs that make up the top 30% of total invoice amount sorted by descending invoice amount.

WITH SET [top30pct jobs] ASTOPPERCENT( [Dim Project].[Project Name].[Project Name].members, 30, [Measures].[Invoice Amount])

SELECT NON EMPTY [Measures].[Invoice Amount] ON COLUMNS,NON EMPTY [top30pct jobs]

ON ROWSFROM [Summary Perspective];

64

Page 65: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

MDX Query (using GENERATE and TOPCOUNT)

For 2005, show each job and the top three employees who worked the most hours on that job.

Show the jobs in alphabetical order and for each job show the employees in hours worked order.

WITH SET [Top3EmployeesHoursForJobs] ASGENERATE( [Dim Project].[Project Name].[Project Name].members, ([Dim Project].[Project Name].CurrentMember, TOPCOUNT( [Dim Employee].[Full Name].[Full Name].members, 3, [hours worked] ) ) )

SELECT NON EMPTY [hours worked] ON COLUMNS,NON EMPTY [top3employeeshoursforjobs] ON ROWSFROM [Labor Perspective]WHERE [2005];

65

Page 66: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

MDX Query (using Calculated Members)

For Carl Imhoff, show a list of projects and LaborCost, LaborCost for all employees, and LaborCost as a percent of LaborCost for all employees, sorted by the percent -where Carl has LaborCost for that project.

WITH MEMBER [LaborCostAllEmployees] AS([Measures].[Labor Cost] , [Dim Employee].[Full Name].currentmember.parent), FORMAT_STRING = ‘Currency'

MEMBER [LaborCost Pct of AllEmployees] AS([Measures].[Labor Cost]/[Measures].[LaborCostAllEmployees] ) , FORMAT_STRING = ‘Percent'

SELECT NON EMPTY { [labor cost], [laborcostallemployees], [laborcost pct of allemployees] }ON COLUMNS,NON EMPTY ORDER( FILTER(

[Dim Project].[Project Name].[Project Name].members,[hours worked] > 0 ),

[laborcost pct of allemployees], bdesc) ON ROWSFROM [Labor Perspective] WHERE [Dim Employee].[Full Name].&[CARL IMHOFF]; 66

Page 67: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

MDX Query (using a Calculated Member Aggregation)

Show jobs in order of total purchase amount and show the breakdown in each job by material type (e.g. Job A, total purchase amount, amount for fuel, amount for materials, amount for petty cash, etc.) in hierarchy order.

WITH MEMBER [Dim Material Type].[Material Type].[Total Purchase Amount] ASSUM([Dim Material Type].[Material Type].[Material Type].members, [purchase cost]),FORMAT_STRING = ‘Currency'

SELECT NON EMPTY {[total purchase amount],[Dim Material Type].[Material Type].[Material Type].members }ON COLUMNS,NON EMPTYORDER([Dim Project].[Project Hierarchy].[Project Name].members,[total purchase amount], BDESC)ON ROWSFROM [Material Perspective]WHERE [Measures].[Purchase Cost]

67

Page 68: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

MDX Query (a Moving Average)

Show jobs in order of total purchase amount and show the breakdown in each job by material type (e.g. Job A, total purchase amount, amount for fuel, amount for materials, amount for petty cash, etc.) in hierarchy order.

WITH MEMBER [52 wk OH cost moving avg] ASAVG ( FILTER( LASTPERIODS(52, [Dim Dates]. [Weekend]. CurrentMember. PrevMember), [Overhead Cost] > 0 ),

[Overhead Cost]), FORMAT_STRING = ‘Currency‘

SET [DataWeeks] AS FILTER([Dim Dates].[Weekend].[Weekend].members, [overhead cost] > 0 )

SELECT NON EMPTY[52 wk OH cost moving avg] ON COLUMNS, NON EMPTY [DataWeeks].Item(52) : TAIL([DataWeeks], 1).Item(0) ON ROWSFROM [Overhead Perspective]

68

Page 69: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

SSRS-PPS-Excel Services ProjectSQL Server 2008

SetFocus Business Intelligence Master’s Program

Jeff Jacob, MBAP: (312) 772-6142E1: [email protected]: [email protected]

TOC

Page 70: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

70

• Develop reporting solutions for AllWorks, Inc. based on the OLAP database, according to specifications, employing SSRS, PerformancePoint Server Dashboard Designer and Excel Services• Create user-configurable Scorecards, Report Tables and Charts using PerformancePoint

Server Dashboard Designer• Create user-configurable Report Charts employing SSRS• Create user-configurable Report Pivot Tables and Charts in MS Excel 2007 and

incorporate these into PerformancePoint Server Dashboards•Deploy these reporting solutions to desired SharePoint collection site folders for distribution

Project Objectives

Page 71: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

71

Developing a Scorecard for KPI reporting

First, the Analysis Services Scorecard template is chosen.

The first scorecard: Scorecards

Data Source: AllWorks_Overhead (cube perspective)KPI source: ImportedKPI selected: KPI Overhead Trend (see OLAP project for details)KPI Display Name Override: Overhead Trend

Goal and Status Properties: * Show no value * Score rollup type = none * Name override = Status

KPI Properties: * Value number format = %; Decimal places = 2 * Scoring pattern and indicator – default / stoplight

Display requirement – display Overhead Trend KPI data broken out for the OverheadType attribute hierarchy members including the summary ‘all’

Publish All – confirm output in Scorecard editor

Page 72: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

72

Developing a second Scorecard for KPI reporting

First, the Analysis Services Scorecard template is chosen.

The second scorecard: JKJ_Client Job Financials

Data Source: AllWorks_Summary (cube perspective)KPI sources: Imported KPIs selected: Objective (Summary) KPI: Client Financials

• KPI Open Receivables as Pct of Invoice • KPI Profit Pct

Objective (Summary) KPI: Construction Job Financials

• KPI Overhead as Pct of Total Cost

Goal and Status Properties: * Show no value * Score rollup type = none * Name override = Status

KPI Properties: * Value number format = %; Decimal places = 2 (1 for Profit Pct) * Scoring pattern and indicator – default / stoplight

Display requirement – show Client Financials KPIs broken out by Client Name; show Construction Job Financials KPI broken out by Project Name

Publish All – confirm output in Scorecard editor

Page 73: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

73

Using the Scorecards for reporting in a dashboard

Lastly, the Dashboard Page, Scorecards, is set up to display the two foregoing scorecards, the first of which is to be configurable by Date Quarters

It will consist of three zones (the filter, the first scorecard, the second scorecard)

The Overhead Quarter Filter is set up employing the AllWorks_Overhead perspective’s Named Set: [OverheadQuarters]

This filter is then linked only to the ScoreCards scorecard for end-user run-time configuration

Page 74: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

74

Using the Scorecards for reporting in a dashboard

The SharePoint deployed ScoreCards dashboard:

Page 75: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

75

Creating a Reporting (Analytic) Column Chart

A new PerformancePoint Report, Material Purchases is added and defined using a custom MDX query: * On Columns statement = bottom (x-) axis of chart * On Rows statement = vertical (y-) axis of chart (material types as measured by cost) * WHERE statement filters members; here, user-configurable Client Name parameter is added

In the dashboard page, Materials, a Client Name filter is set up, using the [Client Plus All] named set and linked to this report/Client Parameter; per specification, it is designed to be used for one attribute hierarchy member at a time (All or individual members)

Material purchase costs by date quarters

Page 76: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

76

Using the PPS Materials report in a dashboard

The SharePoint deployed Materials dashboard page:

Page 77: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

77

Creating a Reporting (Analytic) Line Chart

A new PerformancePoint Report, Overhead Cost is added and defined using a custom MDX query: * On Columns statement = bottom (x-) axis of chart * On Rows statement = vertical (y-) axis (user-configurable Overhead types in terms of the cost measure * WHERE statement here, sets the context - the cost measure

In the dashboard page, Materials, a Client Name filter is set up, using the [All Overhead Types] named set and linked to this report/OHTypeFilter Parameter; per specification, it is designed to be used for one or several attribute hierarchy members (only individual members)

Overhead costs by date quarters

Page 78: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

78

Using the PPS Overhead report in a dashboard

The SharePoint deployed Overhead dashboard page:

Page 79: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

79

Creating Reporting (Analytic) Grids/Tables

A new PerformancePoint Report, Top 10 Labor Jobs is added and defined using the report designer and then customized: * On Columns statement = column(s) of grid/table – here, Labor Cost * On Rows statement = row(s) of grid/table – here, Top 10 projects according to the measure, Labor Cost * WHERE statement filters the user-configurable date quarters

Labor costs by project, configurable by date quartersLabor costs by worker, configurable by date quarters

A new PerformancePoint Report, Top 5 Workers is added and defined using the report designer and then customized: * On Columns statement = column(s) of grid/table – here, Labor Cost * On Rows statement = row(s) of grid/table – here, Top 5 workers according to the measure, Labor Cost * WHERE statement filters the user-configurable date quarters

Page 80: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

80

Using the PPS Labor report in a dashboard

In the dashboard page, Labor, a Quarter filter is set up, using the [Labor Quarters] named set and linked to these reports/Quarter Filter Parameter; per specification, it is designed to be used for one attribute hierarchy member at a time (excluding the ‘All’ member)

Page 81: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

81

Using the PPS Labor reports in a dashboard

The SharePoint deployed Labor dashboard page:

Page 82: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

82

Creating a Reporting (Analytic) Column-Line Chart

A new PerformancePoint Report, Pct of Quarterly Labor Dollars is added and defined using a custom MDX query: * A calculated member [Total AllEmps Labor] is defined to provide the total labor cost for all projects in context (a filtered set) for all employees who worked on them * A calculated member [Total Labor] is defined to rename the Labor Cost measure according to desired specifications * A calculated member [% Total] is defined to provide the percentage of total labor cost that an employee incurred (projects the employee worked) * On Columns statement = bottom (x-) axis of chart, here – date quarters * On Rows statement = vertical (y-) axis of chart, here – the selected employee’s labor cost as measured in labor cost dollars * WHERE statement filters members; here, a user-configurable Employee parameter is added

Employee labor costs and percent of total by employee (name)

Page 83: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

83

Creating a Reporting (Analytic) Grid

A new PerformancePoint Report, % of Labor Dollars by Project is added and defined using a custom MDX query: * A calculated member [Labor All Employees] is defined to provide the total labor cost for all employees in context of the project * A calculated member [Tot Labor] is defined to rename the Labor Cost measure according to desired specifications * A calculated member [% Total] is defined to provide the percentage of total labor cost that an employee incurred (projects the employee worked) * On Columns statement = grid/table column headers, here – the employee labor analysis measures (based on the foregoing calculated members) * On Rows statement = grid/table row headers, here – the filtered set of projects - those, on which the selected employee worked * WHERE statement filters members; here, a user-configurable Employee parameter is added

Employee labor analysis by project, configured by employee

Page 84: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

84

Using the PPS Employee Analysis report in a dashboard

In the dashboard page, Employee Labor Analysis, an Employee filter is set up, using a custom MDX tuple set and linked to these reports/Employee Filter Parameter; per specification, it is designed to be used for one attribute hierarchy member at a time (excluding the ‘All’ member)

Page 85: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

85

Using the PPS Employee Labor Analysis reports in a dashboard

The SharePoint deployed Employee Labor Analysis dashboard page:

Page 86: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

86

Developing a Reporting Services (Analytic) Grid/Table

Report Name: Overhead CategoryData Source: AllWorksOLAP cube (Overhead perspective)Tablix Object: Table

Column Headers: Description (Overhead Types), Prev Qtr, Current Qtr, Pct Change

One user-configurable parameter: Date Quarter

The primary report data set:

Overhead costs, broken out by type, with respect to configurable quarter, the previous quarter and the percent change

Using custom MDX to default the Date Quarter parameter to the last one with activity:

Modification of report code to permit customization of MDX code for Report Data data sets:

Page 87: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

87

Designing and deploying the SSRS Overhead Category report

The SharePoint deployed Overhead Category report:

The SSRS design for Overhead Category report:

Page 88: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

88

Subscribing to the SSRS Overhead Category reportThe MOSS 2007 subscription to the SSRS-designed Overhead Category report:

* Credentials for the data source to this report were added to make the subscription possible

Page 89: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

89

Developing a second Reporting Services (Analytic) Grid/Table

Report Name: Employee Jobs in Date RangeData Source: AllWorksOLAP cube (Labor perspective)Tablix Object: Table

Column Headers: ID, Full Name, Week End Date, Project Name, Hours Worked, Labor Cost

Three user-configurable parameters: Full Name, From Weekend Date, To Weekend Date (cascading parameters; Name selection determines available weekend dates

The primary report data set design:

Project labor cost and hours, detailed by weekend and project, configurable by: employee name, “from” weekend date and “to” weekend date

Using custom MDX to restrain available weekend dates according to the selected employee:

Page 90: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

90

Designing and deploying the second SSRS Employee Jobs in Date Range report

The SharePoint deployed Employee Jobs in Date Range report:

The SSRS design for the Employee Jobs in Date Range report:

Page 91: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

91

Creating a PivotTable for Excel Services

Connected to the AllWorksOLAP Overhead perspective, the following measures and dimensions were chosen; quarters displayed, year configurable – to create the below Pivot Table

Overhead cost by Type and Quarters (configured for a desired year)

To avoid duplicate display, the top two rows of the above spreadsheet were hidden; cell B1 was named and surfaced as a parameter in Excel Services Options; this pivot table as a single workbook item object was selected for SharePoint site publishing

Page 92: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

92

Adding the Pivot Table from Excel Services to a dashboard

The .ODC file, the connection string back to the Overhead perspective of the AllWorksOLAP cube, was also deployed to the SharePoint collection site – data sources library; custom MDX used to define the Year filter (one Year member at a time)

* For each Excel-based report, the Excel-designed product was first uploaded to the SharePoint collection site, then downloaded into PPS where it became a useable report object to be integrated into the respective dashboard (shown above) page

Page 93: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

93

Using the Basic Overhead By Quarter/Year pivot table report in a dashboard

The SharePoint deployed Basic Overhead By Dates dashboard page:

Page 94: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

94

Creating a Pivot Chart for Excel Services

Connected to the AllWorksOLAP Labor perspective, the following measures and dimensions were chosen; quarters displayed, year and client name configurable – to create the below pivot chart

Labor cost by Quarters, broken out by Employee Type

To avoid duplicate display, the top two rows of the above spreadsheet were covered over by the pivot chart; cells B1 and C1 were named and surfaced as parameters in Excel Services Options; this pivot chart as a single workbook item object was selected for SharePoint site publishing

Page 95: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

95

Adding the Pivot Chart from Excel Services to a dashboard

The .ODC file, the connection string back to the Labor perspective of the AllWorksOLAP cube, was also deployed to the SharePoint collection site – data sources library; custom MDX used to define the Year and Client Name filters (for each, multiple selections enabled)

Page 96: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

96

Using the Quarterly Labor Breakdown pivot chart report in a dashboard

The SharePoint deployed Labor History Chart dashboard page:

Page 97: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

97

Creating a Pivot Chart for Excel Services

Connected to the AllWorksOLAP Summary perspective, the following measures and dimensions were chosen; quarters (from DimProject role-playing dimension) displayed, county name configurable – to create the below pivot chart

Profit Dollars and Percent by Quarters (configured for one or several counties)

To avoid duplicate display, the top row of the above spreadsheet was covered over by the pivot chart; cell B1 was named and surfaced as a parameter in Excel Services Options; this pivot chart as a single workbook item object was selected for SharePoint site publishing

Page 98: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

98

Adding the Pivot Table from Excel Services to a dashboard

The .ODC file, the connection string back to the Summary perspective of the AllWorksOLAP cube, was also deployed to the SharePoint collection site – data sources library; custom MDX used to define the County Name filter (multiple selections enabled)

Page 99: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

99

Using the Quarterly Job Profit By County pivot chart report in a dashboard

The SharePoint deployed Job Profitability Chart dashboard page:

Page 100: Business Intelligence Portfolio SetFocus Business Intelligence Master’s Program Jeff Jacob, MBA P: (312) 772-6142 E1: Jeffrey.K.Jacob@gmail.comJeffrey.K.Jacob@gmail.com

100

Back to T-SQL Back to ETL

Back to OLAP Back to MDX

Back to SSRS-PPS-Excel reports for MOSS 2007