Transcript
Page 1: Business Intelligence Portfolio

BUSINESSINTELLIGENCE

PORTFOLIOChris Seebacher

September 11, [email protected]

Page 2: Business Intelligence Portfolio

Table of Contents

Contents Page

Data Modeling 3

SQL Programming 6

SQL Server Integration Services (SSIS) 9

SQL Server Analysis Services (SSAS) 13

MDX Programming 20

SQL Server Reporting Services (SSRS) 24

MS Performance Point Server (PPS) 27

MS Office Excel Services 2007 31

MS Office SharePoint Server 2007 (MOSS) 34

This portfolio contains examples that were developed while participating in the SetFocus Microsoft Business Intelligence Masters Program.

Page 3: Business Intelligence Portfolio

DATA MODELING

Page 4: Business Intelligence Portfolio

Relational Physical Model of the database used in a team project. This database tracked evaluations submitted by students and was

used to build a series of charts and reports that allowed instructors to see how they were performing over a variety of metrics.

Page 5: Business Intelligence Portfolio

Data Model of a Star Schema used to create a staging area to import data for a project. This project was used to track book sales by author,

customer and region. Examples how it was used are found in the following section.

Page 6: Business Intelligence Portfolio

SQL PROGRAMMING

Page 7: Business Intelligence Portfolio

The queries in this section used the staging area shown in the previous section. This query returns all publishers with books that are currently out of stock, quantities still needed, and order status, ordered by greatest quantity needed first .

SELECT books.ISBN, title as [Book Title], PUBLISHER, QUANTITYORDERED-QUANTITYDISPATCHED AS [Quantity Needed], orders.orderid, case

when orderdate+3 < getdate() and quantityordered>quantitydispatchedthen 'Needs Review' else 'Standard Delay'

end AS [STATUS]FROM BOOKS inner join ORDERITEMS on books.isbn=orderitems.isbninner join orders on orderitems.orderid=orders.orderidWHERE QUANTITYORDERED>QUANTITYDISPATCHED and stock=0group by books.ISBN, title, PUBLISHER, orderdate, orders.orderid, quantityordered,

quantitydispatchedorder by [quantity needed] desc

Page 8: Business Intelligence Portfolio

This query determines the list of countries from which orders have been placed, the number of orders and order items that have been had from each country, the percentages of the total orders, and the percentages of total order items received from each country--Create temporary table select

[Country], count(OrderNum) as [Total Orders], sum(QuantityOrdered) as [Total Items Ordered] into #C_Totals

from(select right(address, charindex(' ',reverse(address))-1) as 'Country', customers.customerID , orders.orderID as 'OrderNum', orderItems.orderItemID, case

when QuantityOrdered is nullthen 0else QuantityOrderedend as QuantityOrdered

from ordersinner join orderItems

on orders.orderID=orderItems.orderIDright join customers

on orders.customerID=customers.customerIDgroup by QuantityOrdered,

customers.customerID, address, orders.orderID, orderItems.OrderItemID

) as C_Ordersgroup by [Country] with rollup--Query temporary table to extract, calculate and format data appropriatelyselect [Country], [Total Orders], [Total Items Ordered], (convert(numeric(10,4),([Total Orders]/(select convert(numeric,[Total Orders]) from #C_Totals where [Country] is null)))*100) as [% of Total Orders] , (convert(numeric(10,4),([Total Items Ordered]/(select convert(numeric,[Total Items Ordered]) from #C_Totals where [Country] is null)))*100) as [% of Total Items Ordered] from #C_Totalswhere [Country] is not null group by [Country], [Total Orders], [Total Items Ordered] -- Should clean up afterwardsdrop table #C_Totals

Page 9: Business Intelligence Portfolio

SQL SERVER INTEGRATION SERVICES

(SSIS)

Page 10: Business Intelligence Portfolio

This is the data flow and control flow for the Job Time Sheets package. This package imports multiple csv files doing checks to insure data integrity and writing rows that fail to an error log file for review. This is just one part of a project that brought in the employee and customer data of a construction company. The data

structure created here was used in several subsequent BI projects.

Page 11: Business Intelligence Portfolio

This is the script that tracks how many records were processed for the Job Time Sheets package. It breaks them up into Inserted, Updated and Error categories. These totals are used in the email that is sent when processing is completed.

' Microsoft SQL Server Integration Services Script Task' Write scripts using Microsoft Visual Basic' The ScriptMain class is the entry point of the Script Task.

Imports SystemImports System.DataImports System.MathImports Microsoft.SqlServer.Dts.Runtime

Public Class ScriptMainPublic Sub Main() Dim InsertedRows As Integer = CInt(Dts.Variables("InsertedRows").Value) Dim ErrorRows As Integer = CInt(Dts.Variables("ErrorRows").Value) Dim RawDataRows As Integer = CInt(Dts.Variables("RawDataRows").Value) Dim UpdatedRows As Integer = CInt(Dts.Variables("UpdatedRows").Value) Dim InsertedRows_fel As Integer = CInt(Dts.Variables("InsertedRows_fel").Value) Dim ErrorRows_fel As Integer = CInt(Dts.Variables("ErrorRows_fel").Value) Dim RawDataRows_fel As Integer = CInt(Dts.Variables("RawDataRows_fel").Value) Dim UpdatedRows_fel As Integer = CInt(Dts.Variables("UpdatedRows_fel").Value)

Dts.Variables("InsertedRows").Value = InsertedRows + InsertedRows_fel Dts.Variables("ErrorRows").Value = ErrorRows + ErrorRows_fel Dts.Variables("RawDataRows").Value = RawDataRows + RawDataRows_fel Dts.Variables("UpdatedRows").Value = UpdatedRows + UpdatedRows_fel Dts.TaskResult = Dts.Results.Success

End Sub

End Class

Page 12: Business Intelligence Portfolio

This is the data flow of a package that merged data from multiple tables together in order to create a fact table for a cube. This fact table was the key fact table used in the final

BI project for our class.

Page 13: Business Intelligence Portfolio

SQL SERVER ANALYSIS SERVICES

(SSAS)

Page 14: Business Intelligence Portfolio

This section uses the staging area that was created in the SSIS section. Here the data is deployed from the staging area into

a cube and SSAS is used to create KPIs and Excel Reports.

The AllWorks database deployed as a cube using SSAS

Page 15: Business Intelligence Portfolio

Browsing the AllWorks data cube to make sure the data is organized in the desired manner for purposes in

which it will be used.

Page 16: Business Intelligence Portfolio

Creating Calculated Members for use in KPIs and Excel Reports

Page 17: Business Intelligence Portfolio

Creating Key Performance Indicators (KPIs) to show visually goals, trends

and changes in tracked metrics

Page 18: Business Intelligence Portfolio

Use of a KPI in Excel to show Profits against projected goals.

Page 19: Business Intelligence Portfolio

Partitioning the cube to separate archival data from more frequently accessed data. Also Aggregations were setup here to further enhance storage and query performance.

Page 20: Business Intelligence Portfolio

MDX PROGRAMMING

Page 21: Business Intelligence Portfolio

This section uses the AllWorks cube created in the last section. The code created here was used in created calculations for use in KPIS.

For 2005, show the job and the top three employees who worked the most hours. Show the jobs in job order, and within the job show the employees in hours worked order

SELECT[Measures].[Hoursworked]ON COLUMNS,non empty Order(Generate([Job Master].[Description].[Description].members,

([Job Master].[Description].currentmember,TOPCOUNT([Employees].[Full Name].[Full Name].members,3,[Measures].[Hoursworked]))),[Measures].[Hoursworked],DESC)

on rowsFROM AllworksWHERE[All Works Calendar].[Fy Year].&[2005]

Page 22: Business Intelligence Portfolio

Show Overhead by Overhead Category for currently selected quarter and the previous quarter, and also show the % of change between the two.

WITHMEMBER [Measures].[Previous Qtr] AS

([Measures].[Weekly Over Head],ParallelPeriod ([All Works Calendar].[Fy Year - Fy Qtr].level

,1,[All Works Calendar].[Fy Year - Fy Qtr].currentmember) ),FORMAT_STRING = '$#,##0.00;;;0‘

MEMBER [Measures].[Current Qtr] AS([Measures].[Weekly Over Head],[All Works Calendar].[Fy Year - Fy Qtr].currentmember),FORMAT_STRING = '$#,##0.00;;;0‘

MEMBER [Measures].[% Change] ASiif([Measures].[Previous Qtr], (([Measures].[Current Qtr] - [Measures].[Previous Qtr]) / [Measures].[Previous Qtr]),NULL),FORMAT_STRING = '0.00%;;;\N\/\A‘

SELECT{[Measures].[Current Qtr], [Measures].[Previous Qtr], [Measures].[% Change]}on columns,non empty [Overhead].[Description].memberson rowsFROM AllworksWHERE [All Works Calendar].[Fy Year - Fy Qtr].[2005].lastchild

Page 23: Business Intelligence Portfolio

List Hours Worked and Total Labor for each employee for 2005, along with the labor rate (Total labor / Hours worked). Sort the employees by labor rate descending, to see the employees with

the highest labor rate at the top.

WITHMEMBER [Measures].[Labor Rate] AS[Measures].[Total Labor]/[Measures].[Hoursworked],FORMAT_STRING = 'Currency'

SELECT{[Measures].[Hoursworked],[Measures].[Total Labor],[Measures].[Labor Rate]}ON COLUMNS,non empty Order([Employees].[Full Name].members,[Measures].[Labor Rate], BDESC)on rowsFROM AllworksWHERE[All Works Calendar].[Fy Year].&[2005]

Page 24: Business Intelligence Portfolio

SQL SERVER REPORTING SERVICES

(SSRS)

Page 25: Business Intelligence Portfolio

This report uses the AllWorks cube and shows an employees labor cost by weekending date with a grand total at the bottom.

Cascading parameters are used to select the employee and dates.

Page 26: Business Intelligence Portfolio

A report of region sales percentage by category for a selected year.

Page 27: Business Intelligence Portfolio

MS PERFORMANCE POINT SERVER (PPS)

Page 28: Business Intelligence Portfolio

A breakdown of the labor cost of an employee by quarter. The line graph shows the percentage of labor of the employee for the quarter. The chart at the bottom shows the breakdown by job.

These use the AllWorks cube created earlier.

Page 29: Business Intelligence Portfolio

The custom MDX code that allows the previous report to run

Page 30: Business Intelligence Portfolio

This scorecard has a drill down capability that will allow you to see regions, states and city Sales goals. In addition it is hot

linked to a report that shows Dollar Sales.

Page 31: Business Intelligence Portfolio

MS OFFICE EXCEL SEVICES 2007

Page 32: Business Intelligence Portfolio

This excel spreadsheet has taken data from a cube and created a chart. This chart and its parameter will then be published using Excel Services to make it available

on a Sharepoint server.

Page 33: Business Intelligence Portfolio

Another chart built using Excel with data from a cube. This chart allows the tracking of sales data by Category on a selected year. In addition it tracks the selected category percentage of sales vs. the parent on a separate axis. This chart with its parameters was

published to SharePoint Server using Excel Services.

Page 34: Business Intelligence Portfolio

MS OFFICE SHAREPOINT SERVER

(MOSS)

Page 35: Business Intelligence Portfolio

SharePoint site created with document folders to hold Excel spreadsheets published with Excel Services, SSRS reports, and Performance Point

Dashboards. Two web parts are on the front page showing a Excel chart and SSAS KPI published through Performance Point.

Page 36: Business Intelligence Portfolio

The previously shown Employee Labor Analysis Report deployed to SharePoiont as part of A Performance Point

Dashboard.

Page 37: Business Intelligence Portfolio

An SSRS reported scheduled to be autogenerated using SharePoint scheduling and subsription services

Page 38: Business Intelligence Portfolio

Excel spreadsheets and charts deployed to SharePoint using Excel Services.


Recommended