Top Banner
Business Intelligence Portfolio Robert N. Litsinger [email protected]
38

Business Intelligence Portfolio

Jan 26, 2015

Download

Documents

Bob Litsinger

An overview of training and capabilities
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Business Intelligence Portfolio

Business Intelligence PortfolioRobert N. [email protected]

Page 2: Business Intelligence Portfolio

ContentsThis portfolio contains examples of my skills in the Business Intelligence arena.

Data Modeling 3

SQL Programming 6

SQL Server Integration Services (SSIS) 10

SQL Server Analysis Services (SSAS) 14

MDX Programming 19

SQL Server Reporting Services (SSRS) 22

Excel Power Pivot 24

Performance Point Services (PPS) 26

SharePoint Services 30

SQL and MDX Presentations 36

Experience Summary 37

Recommendations 38

Page 3: Business Intelligence Portfolio

D A T A M O D E L I N G

3

Page 4: Business Intelligence Portfolio

AllWorks Data WarehouseA data warehouse model must consider both the available data and reporting

needs to be supported.

4

Page 5: Business Intelligence Portfolio

Data Modeling Alternatives

Even a small data warehouse might have alternate designs that need to be tested for support of the needs of SSAS or SSRS development.

5

Page 6: Business Intelligence Portfolio

S Q L P R O G R A M M I N G

6

Page 7: Business Intelligence Portfolio

A Table Value FunctionThe function returns a product and the price as of a give date.

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

CREATE FUNCTION dbo.GetStandardCostByDate(@ProdNum NVARCHAR(25), @CostDate AS DATETIME)

RETURNS TABLEASRETURN

SELECT PP.ProductID, PP.ProductNumber, PP.Name, ROUND(PCH.StandardCost,2) AS RoundedStandCostFROM Production.ProductCostHistory PCHJOIN Production.Product PP ON PCH.ProductID = PP.ProductIDWHERE StartDate < DATEADD(DAY,1,@CostDate) AND PP.ProductNumber = @ProdNum AND ( PCH.EndDate is null OR PCH.EndDate >= @CostDate )

GO

The function can be used to return the price for a single item,

DECLARE @ProdNum NVARCHAR(25) = 'BK-R89R-58‘ , @CostDate DATETIME = '1/1/2008'

SELECT * FROM dbo.GetStandardCostByDate (@ProdNum,@CostDate)

. . . or it could be used to return a list based on addition selection criteria.

SELECT GET.ProductNumber , GET.Name , GET.RoundedStandCostFROM Production.Product PPCROSS APPLY dbo.GetStandardCostByDate (PP.ProductNumber, GETDATE()) GETWHERE GET.RoundedStandCost >= 1500ORDER BY GET.RoundedStandCost DESC

Both uses are potentially valuable in .NET and web based applications.

7

Page 8: Business Intelligence Portfolio

A Pivot Table with Dense Rank Query Pivot tables can be produced in many of the BI layers beginning with SQL. This example provides output that is useful in reporting and applications.

;WITH SaleByShipper AS( SELECT DATEADD(DAY, 7 - DATEPART(WEEKDAY,OrderDate),OrderDate) AS WeekEnding

, ShipMethodID, SUM(TotalDue) AS ShipperTotal

FROM Purchasing.PurchaseOrderHeader POHWHERE YEAR(DATEADD(DAY, 7 - DATEPART(WEEKDAY,OrderDate),OrderDate)) = 2007GROUP BY DATEADD(DAY, 7 - DATEPART(WEEKDAY,OrderDate),OrderDate)

, ShipMethodID)

SELECT WeekEnding, [1] AS XRQ, [2] AS ZY , [3] AS OVERSEAS , [4] AS OVERNIGHT , [5] AS CARGO

INTO #PivotFROM SaleByShipper

PIVOT ( SUM(ShipperTotal) FOR ShipMethodID IN ([1], [2], [3], [4], [5])) AS ShipDol

SELECT TOP 5 REPLACE(CONVERT(CHAR(10),WeekEnding,111),'/','-') AS WeekEnding, ISNULL(XRQ,0) + ISNULL(ZY,0) + ISNULL(OVERSEAS,0) +

ISNULL(OVERNIGHT,0) + ISNULL(CARGO,0) AS GrandTotal, DENSE_RANK() OVER (ORDER BY ISNULL(XRQ,0) + ISNULL(ZY,0) +

ISNULL(OVERSEAS,0) + ISNULL(OVERNIGHT,0) + ISNULL(CARGO,0) DESC) AS [Rank], XRQ, ZY , OVERSEAS , OVERNIGHT , CARGO

FROM #Pivot

8

Page 9: Business Intelligence Portfolio

Segments of a Stored ProcedureProducing a dual ranked output that has application uses for reporting.

SELECT * INTO #VendorFROM( SELECT

VEN.BusinessEntityID,

VEN.Name AS VendorName,

DENSE_RANK() OVER (ORDER BY SUM(TotalDue) DESC) AS VendorRank

,SUM(POH.TotalDue) AS TotalDueFROM

Purchasing.Vendor VENJOINPurchasing.PurchaseOrderHeader POH

ONPOH.VendorID =

VEN.BusinessEntityIDWHERE POH.OrderDate>= @StartDate

ANDPOH.OrderDate <

DATEADD(DAY,1,@EndDate)GROUP BY

VEN.BusinessEntityID,

VEN.Name) vendaliasWHERE VendorRank <= @TopVend

In a stored procedure

a temporary table built using a sub-query to build a Vendor Ranking,

and a similar query on Products

are joined in a final query

to provide a combined ranked listing of vendors and products.

EXEC dbo.TopProductForTopVendorSales@TopVend = 3, @TopProd =

3, @StartDate = '1/1/2007', @EndDate = '6/30/2008'

GO

SELECTV.VendorName

,V.VendorRank

,V.TotalDue

,P.ProductName

,P.ProductRank

,P.ProductTotalDue

FROM#Vendor V

JOIN#Product PONP.VendorID = V.BusinessEntityID

ORDER BY V.VendorRank,

P.ProductRank

9

Page 10: Business Intelligence Portfolio

S Q L S E R V E R I N T E G R A T I O N S E R V I C E S( S S I S )

10

Page 11: Business Intelligence Portfolio

The AllWorks Construction Company

The first step was the creation of the relational database using SQL.

This was followed by the development of an ETL process using SQL Server Integration Services.

The process was deployed to SQL Server Agent.

The deployed SSIS process is designed to do an initial load of the data as well as to be used for regular, ongoing processing of data.

The source included files from Excel, CSV and XML.

A series of real world projects are undertaken for a fictional construction firm. After creation of the database, an SQL Server Integration Services package was created to process the data.

11

Page 12: Business Intelligence Portfolio

Processing Employee Time RecordsThis process is used for the initial load of time records, but designed for scheduled processing that can be done daily or at any selected frequency. The process validates Projects and Employees and produces a single report of invalid records. Records that pass validation are checked for late time and a separate late time report is produced. Only records passing all three tests are inserted, and reports are sent by e-mail for invalid records and late time. Multiple source files are received and processed in a ForEach Loop in Control Flow.

Control Flow

Data Flow

12

Page 13: Business Intelligence Portfolio

Master ETL Control Flow A Master Control Flow was used to assure that the file processing order was sequenced to process primary keys before use of the primary key as a foreign key. The process began with control tables and ended with secondary transaction tables. Once processing is complete, database maintenance tasks are done in a final step.

13

Page 14: Business Intelligence Portfolio

S Q L S E R V E R A N A L Y S I S S E R V I C E S( S S A S )

14

Page 15: Business Intelligence Portfolio

Browsing the All Works Cube DataThe AllWorks OLTP database was staged to provide the OLAP cube shown here in the browser.

One of the features of the cube is the ability to click on a county and open a map centered on the county.

15

Page 16: Business Intelligence Portfolio

Creating A Staging Area for OLAP Deployment

;WITH EndDateCTE AS(SELECT DISTINCT [dbo].[WeekEndingDate](JobClosedDate) AS Dates FROM dbo.JobMasterUNIONSELECT DISTINCT [dbo].[WeekEndingDate](WorkDate) FROM dbo.JobTimeSheetsUNIONSELECT DISTINCT [dbo].[WeekEndingDate](PurchaseDate)FROM dbo.JobMaterialPurchasesUNIONSELECT [dbo].[WeekEndingDate]('Oct 2, 2004') -- DEFAULT JobCloseDate)INSERT INTO [AllWorksDW].[dbo].[DimDate]SELECT dbo.WeekEndingKey(Dates)

, CONVERT(VARCHAR(12),Dates, 107), CAST(CAST(YEAR(Dates) as varchar(4)) + CAST(DATEPART(qq,Dates) as varchar(1)) AS INT), 'Q' + CAST(DATEPART(Q,Dates) as varchar(1)) + '-' + CAST(YEAR(Dates) as varchar(4)) , YEAR(Dates)

FROM EndDateCTE WHERE Dates > '12/31/2003'

CREATE FUNCTION [dbo].[WeekEndingDate] ( @InputDate date ) -- 9-20-2010 RETURNS Date ASBEGIN DECLARE @ReturnDate DATE SET @ReturnDate = dateadd(day, ( @@DateFirst - datepart(weekday,@InputDate)), @InputDate)RETURN @ReturnDateENDGO

A copy of the OLTP Database was loaded to AllWorksDW and T-SQL Programs were used to create and load Fact and Dimension tables.

Fact and Dimensions were created using a combination of:

Views and

Tables created in Stored Procedures

This query creates a function to find the week ending date. A similar function to find the week ending key was also created.

This query was used in a Stored Procedure to create the Date Dimension.

16

Page 17: Business Intelligence Portfolio

Developing A CubeThe AllWorksOLAP cube build included basic structure, dimension usage, calculated members and sets, KPI’s, Actions, Partitions, Aggregations, and Perspectives.

17

Page 18: Business Intelligence Portfolio

A Calculated Member and KPI Definition

18

Page 19: Business Intelligence Portfolio

M D X P R O G R A M M I N G

19

Page 20: Business Intelligence Portfolio

Useful Simple MDX Queries

WITH SET [Weeks] ASFILTER ([Dates].[Calendar Tree].[Weekend], [Overhead Cost] <> null)

MEMBER [MovingXWeekAvg] ASAVG ( LastPeriods ( 52, [Dates].[Calendar

Tree].CurrentMember), ([Overhead Cost]))

SELECT {[Overhead Cost],[MovingXWeekAvg]} ON COLUMNS,[Weeks] ON ROWS

FROM [Overhead]

A query producing a weekly moving average.

WITHMEMBER [Labor Hrs Last Year] AS

( [Worked Hours] , parallelperiod ( [Dates].[Calendar Tree].[Quarter]

, 4

, [Dates].[Calendar Tree].CurrentMember

)) , FORMAT_STRING = 'Standard'

SELECT [Dates].[Quarter] * { [Worked Hours], [Labor Hrs Last Year] } on columns, NON EMPTY [Labor].[Employee Name].Children on rows

from [Labor]WHERE [Dates].[Calendar Tree].[Q4-2005]

Some really simply queries produce interesting, useful results, like this TOPPERCENT query:SELECT [Invoice Amount] on COLUMNS,

TOPPERCENT ([Projects].[Project].children, 30, [Invoice Amount]) ON ROWSFROM [Global]

Comparing this year to last year

20

Page 21: Business Intelligence Portfolio

A More Complex MDX ExampleWITH MEMBER [Internet Sales Amount Prior PD] as ( [Internet Sales Amount] , [Date].[Calendar].PrevMember) , format_string = ‘currency' MEMBER [% Sales Change] AS IIF ( [Internet Sales Amount Prior PD] <> null

, ([Internet Sales Amount] - [Internet Sales Amount Prior PD])

/ [Internet Sales Amount Prior PD], 0)

, format_string = 'percent'

SET [TopMonth] ASTOPCOUNT ( [Date].[Calendar].[Month], 3, [% Sales Change] )

MEMBER [MonthRank] ASRANK ( [Date].[Calendar].CurrentMember, [TopMonth] )

SET [Top3MonthsTop3Cities] ASGENERATE( [TopMonth], ( [Date].[Calendar].CurrentMember,

TOPCOUNT([Customer].[City].Children, 3, [% Sales Change]) ) )

MEMBER [CityRank] asRANK( ( [Date].[Calendar].CurrentMember, [Customer].

[City].CurrentMember), EXISTS( [Top3MonthsTop3Cities], [Date].[Calendar].CurrentMember))

SELECT {[Internet Sales Amount] , [Internet Sales Amount Prior PD],[% Sales Change], [MonthRank], [CityRank] }ON COLUMNS,[Top3MonthsTop3Cities]

ON ROWSFROM [Adventure Works]

This much more complex example calculates the percentage increase in sales over the prior month.

It identifies the months having the greatest increase and ranks these.

It evaluates cities within each of these months for sales increases and ranks those.

Finally the query reports the top 3 months and top 3 cities within those month and reports

the amount of sales for the month and prior month,

the percentage increase,

the ranking of the months, and

the ranking of the cities within those months.

21

Page 22: Business Intelligence Portfolio

S Q L S E R V E R R E P O R T I N G S E R V I C E S( S S R S )

22

Page 23: Business Intelligence Portfolio

Example Reports Developed in SSRS

Employee Sales: Actually is a master report with 4 sub reports.

Promotional Sales: A simple report requiring custom MDX.

The SSRS Project developed reports for deployment in SharePoint.

Sales by state with an accompanying chart of the top 10 states by either sales or returns.

23

Page 24: Business Intelligence Portfolio

E X C E L P O W E R P I V O T R E P O R T

24

Page 25: Business Intelligence Portfolio

Excel Power Pivot Against Contoso Operation Cube

Gridlines and headings are turned of to provide a cleaner appearance when deployed to SharePoint.

Product Category is configured to highlight and preselect valid subcategories.

Geography is based on a hierarchy from the cube, so can be expanded to lower levels.

25

Page 26: Business Intelligence Portfolio

P E R F O R M A N C E P O I N T S E R V I C E S ( P P S ) I N S H A R E P O I N T 2 0 1 0

26

Page 27: Business Intelligence Portfolio

Performance Point Services

Reports were prepared directly in PPS, and reports deployed to SharePoint from SSRS and Excel where brought into SharePoint to be deployed to the Dashboard.

For SSRS reports, the deployment to the Dashboard via PPS enabled the use of superior drop down and tree selections for report parameters.

27

Page 28: Business Intelligence Portfolio

Contoso Retail Scorecard Using SSAS KPIs

KPIs for the Contoso SSAS Operation Cube are used to build a scorecard. Indicators are modified to provide a better web appearance.

When building the Dashboard Page containing the KPIs, the primary KPIs are linked to a different chart that will appear in SharePoint when that KPI is selected. 28

Page 29: Business Intelligence Portfolio

Other PPS Reports

Other Charts and Reports are created directly in PPS.

The Excel Pivot Report is added so that it will be included on the Dashboard.

SSRS Reports are added and deployed to the SharePoint Dashboard using PPS page controls. This not only allows inclusion on the Dashboard, but also enables these reports to use SharePoint selection controls which have a better appearance and are easier to use.

29

Page 30: Business Intelligence Portfolio

S H A R E P O I N T S E R V I C E S

30

Page 31: Business Intelligence Portfolio

Welcome to the SharePoint Contoso Retail Dashboard

31

Page 32: Business Intelligence Portfolio

KPI Scorecard in SharePoint Dashboard

Product Gross Margin selected in KPI.

Returns % selected in KPI.

Channel Revenue selected in KPI.

Machine Downtime Trend selected in KPI.

The right hand chart is set by the select KPI on the left.

32

Page 33: Business Intelligence Portfolio

A Deceptively Simple Chart from PPS

But it has impressive drill down capabilities.

33

Page 34: Business Intelligence Portfolio

Other Dashboard Reports

34

Page 35: Business Intelligence Portfolio

SSRS Scheduled Reports

A simple informational report was created in SSRS, deployed in SharePoint, then versions for Maryland and Virginia were set up for daily production.

35

Page 36: Business Intelligence Portfolio

Demonstration and Educational PresentationsThese presentations, prepared independently, provide education and demonstrations

for anyone interest in T-SQL and MDX query syntax and use. The completed presentations are posted on LinkedIn as SlideShare Presentations.

36

Page 37: Business Intelligence Portfolio

Experience Summary

Over 12 years experience as a analyst, data auditor and T-SQL Programmer for data and financial system implementation and maintenance

Prior experience in accounting and system specification, selection and implementation

MS Business Intelligence

T-SQL Programming

SQL Server Integration Services (SSIS)

SQL Server Analysis Services (SSAS)

MDX Programming

SQL Server Reporting Services (SSRS)

Excel, Excel Services and Power Pivot

SharePoint for Business Intelligence

Performance Point Services (PPS)

37

Page 38: Business Intelligence Portfolio

RecommendationsLetter of Recommendation

Robert Litsinger The following is a letter of reference/recommendation for Robert Litsinger. Robert was enrolled in the SetFocus SQL Server Business Intelligence Master’s Program in the third quarter of 2011 and will graduate on October 21, 2011. I was Robert’s instructor throughout the 12-week program.

Robert brought substantial experience (25+ years) into the Master’s Program, with a background as a systems analyst, database professional, and management consultant. Robert demonstrated very early in our Master’s Program that he “knows data”. His prior work on data conversions in particular came through during many lecture discussions.

Robert performed very well in our Master’s Program curriculum, both during lecture and project weeks. He picked up a great deal of information, performed well on all areas of the BI stack, and often worked on lab assignments in the evenings/weekends after a long day of class. His attention to detail is exactly what every professional instructor hopes to see. The road to learning the Microsoft BI stack is paved with countless details: Robert demonstrated he can integrate them into his thought processes. During our final student team project, we will select Robert as the team lead.

Robert is very intelligent and articulate, and can translate business requirements into results. He has decades of experience in this area that a company will value. He also constructed some documentation of his own as part of the learning curve for MDX programming – several of his ideas were so good that I plan to utilize them for the next class.

Having been a hiring manager, I know that companies are equally concerned about the character of an applicant. Without any exaggeration, Robert is a model of professionalism, especially during periods of adversity. A company will benefit from his experience, capabilities, and work ethic - and will also appreciate his steady demeanor and common sense. He is a quality person who produces quality work. I enjoyed having him in class and appreciated his insights.

I would recommend Robert without hesitation for any SQL Server Business Intelligence developer/management position. Please contact me at [email protected], if you have any additional questions.

Kevin S. Goff | [email protected] SQL Server MVPSetFocus SQL Server Business Intelligence Practice Manager

About SetFocus: SetFocus, LLC (www.setfocus.com) is a Microsoft Certified Gold Partner for Learning Solutions. The Master's Program consists of intensive coverage of T-SQL, SSIS, SSAS, MDX, SSRS, PerformancePoint Server, SharePoint, and Excel Services. Our BI curriculum is one of the most intensive curriculums in the industry. The projects are based on actual project specifications from industry SQL Server and OLAP/Business Intelligence applications.

38