Nitin\'s Business Intelligence Portfolio

32
Business Intelligence Portfolio Nitin Patel [email protected] 714-904-0359

description

 

Transcript of Nitin\'s Business Intelligence Portfolio

Page 1: Nitin\'s Business Intelligence Portfolio

Business Intelligence Portfolio

Nitin Patel

[email protected]

714-904-0359

Page 2: Nitin\'s Business Intelligence Portfolio

Table of Contents

Project Overview 3

T-SQL Samples 4

MDX Samples 7

SSIS – Integration Services 7

SSAS – Analysis Services 12

MDX Samples 14

Calculated Members 17

KPI’s, Trend Indicators, and Excel Services - 18SamplesSSRS – Reporting Services 21 MOSS/PPS – Share Point and 24Performance Point Services

Page 3: Nitin\'s Business Intelligence Portfolio

Project Overview • Sample Business Intelligence Project Work

• This portfolio contains selected examples of my development skills in the Microsoft Business Intelligence arena.

• Core technologies covered: • Microsoft SQL Server 2005 T-SQL • Microsoft SQL Server 2005 MDX • Microsoft SQL Server 2005 • Microsoft SQL Server 2005 Integration Services (SSIS) • Microsoft SQL Server 2005 Analysis Services (SSAS) • Microsoft SQL Server 2005 Reporting Services (SSRS) • Microsoft Office SharePoint Server 2007 (MOSS) • Microsoft Office Performance Point Server (PPS)

• Introduction: Project Summary • Design and build a Business Intelligence solution for a simulated

construction company to track employee, customer, job order, and timesheet information.

Page 4: Nitin\'s Business Intelligence Portfolio

• Define a Star Schema database using Visio (four fact tables) • Create a Staging Database (Visio created the DDL) • Create an ETL solution to update the SQL Server 2005 database

from Excel and flat file sources using SSIS • Create a Star Schema Analysis Services cube with SSAS • Write MDX queries based on specifications • Define Calculated Members and business Key Performance

Indicators (KPIs) in SSAS • Use Excel Services 2007 to display the cube data and the KPIs,

displaying statuses and trends • Produce detail and summary reports using SSRS • Create score cards using MS Office Performance Point • Implement business intelligence dashboards using MOSS 2007

(SharePoint

Project Overview

Page 5: Nitin\'s Business Intelligence Portfolio

T-SQL Samples /* Nitin Patel Query to Join Three tables and display CategoryName, ShipName, and OrderDollars*/

Page 6: Nitin\'s Business Intelligence Portfolio

/* Nitin Patel

Query using Common Table Expression and Cross Join

*/

Page 7: Nitin\'s Business Intelligence Portfolio

/* Nitin Patel

Query using Ties and Rank

*/

Page 8: Nitin\'s Business Intelligence Portfolio

/* Nitin Patel

Query using Rollup

*/

Page 9: Nitin\'s Business Intelligence Portfolio

• Integration Services • Create packages to transfer the data from different raw data sources (Excel,

CSV). Data sources are both normalized and non-normalized. • Do a full load of data into MS SQL Server 2005. • Run scheduled packages nightly to import/update any additional

information. • Perform validation to detect errors (e.g. child records with invalid parent

records). • Generate emails with the results, including rows inserted, updated. Errors

are redirected to log files which become email attachments. • Create a separate package to re-index and shrink the database, as well as

perform nightly backups of the database.

• Screenshots: • This particular package required reading multiple CSV files and totaling

record counts for all files. • Following are the control flow and data flow screenshots. • Control flow for a package

SSIS – Integration Services

Page 10: Nitin\'s Business Intelligence Portfolio

SSIS – Integration Services

Page 11: Nitin\'s Business Intelligence Portfolio

• Notification. This is an example of the settings to send email alerts when an SSIS package completes, and there are invalid dates in the source data. The email has the error information in the Subject line, in the body, and includes the error file with the bad record. Similar emails are sent when data is successfully inserted as well as when data is updated.

SSIS – Integration Services

Page 12: Nitin\'s Business Intelligence Portfolio

SSIS – Integration Services

Page 13: Nitin\'s Business Intelligence Portfolio

Sample email with error information including date and time.

SSIS – Integration Services

SSIS Package to read data from varying number of flat files in a folder. Running totals of rows inserted, updated, and errors generated for all files are kept for notification after the package completes.

Page 14: Nitin\'s Business Intelligence Portfolio

Control Flow

SSIS – Integration Services

Page 15: Nitin\'s Business Intelligence Portfolio

Data flow gets repeated for each source file in the source directory.

SSIS – Integration Services

Page 16: Nitin\'s Business Intelligence Portfolio

• Master Package: This is the master control flow of all the SSIS packages for loading the Staging Database for the AllWorks Data Source View. Several tasks can be done in parallel, while others are dependent on previous tasks being completed.

• After the database is completely loaded, some maintenance tasks are executed – the database is re-indexed, backed-up, and compressed.

• All packages were moved to the server when they were production ready, and a SQL Server Agent was set up to run this Master Package nightly at 12:01 a.m.

SSIS – Integration Services

Page 17: Nitin\'s Business Intelligence Portfolio

• Design the Data Source View using BIDS • Restore the All Works Database from the Backup file. • Create the four fact tables from the scripts provided by the DBA. • Create the calendar table (AllWorksCalendar) from the script

provided by the DBA. • Establish database connection. • Use “Service Account” for login credentials. • Select the tables that we will use, including the fact tables and the

dimension tables. • All tables are indicated in the screen shot that follows. • The DSV relationships are not completely established, and must be

defined manually. Utilize the Data Source View (DSV) Diagram for All Works Data Source, define the primary key foreign key related members between tables, and save.

SSAS – Analysis Services

Page 18: Nitin\'s Business Intelligence Portfolio

• n

SSAS – Analysis Services Here is the DSV Diagram

Page 19: Nitin\'s Business Intelligence Portfolio

• Design the Cube using BIDS • Utilize the Cube Wizard to build the All Works Cube • Automatically create attributes and hierarchies • Verify that the Fact tables and Dimension Tables properly identified • Verify measures by measure group • Verify dimensions • Name cube and finish • Use dimension Usage to verify dimensions used in each fact table • Edit AllWorksCalendar dimension – rename levels and create hierarchy

SSAS – Analysis Services

Page 20: Nitin\'s Business Intelligence Portfolio

Here is the Cube Design and Dimension Editor:

Page 21: Nitin\'s Business Intelligence Portfolio

• /*• AllWorks, Inc. - a Fictitious Construction Company• Developer: Nitin Patel • Company Name: SetFocus• Date: 7/24/2009• Query Name:JobLabor05.mdx• Objective: Show All employees for 2005 Q4, and four periods ago, • for total hours worked in the Quarter.• */ • WITH MEMBER [Measures].[Total Hours YagoUT] AS• ([Measures].[Hoursworked],• PARALLELPERIOD([All Works Calendar].[Fy Year - Fy Qtr].[Fy Qtr]• , 4))•• Member [Measures].[Total Hours Yago] as

iif([Measures]. [Total Hours YagoUT], [Measures].[Total Hours YagoUT],0)

• Member [Measures].[CleanHoursworked] as• iif ([Measures].[Hoursworked],[Measures].[Hoursworked],0)•• SELECT non empty{[Measures].[CleanHoursworked], • [Measures].[Total Hours Yago]} ON columns,• non empty [Employees].[Full Name].members ON rows• FROM [All Works]• WHERE [All Works Calendar].[2005 Q4]

MDX Samples

Page 22: Nitin\'s Business Intelligence Portfolio

• /*• AllWorks, Inc. - a Fictitious Construction Company• Developer: Nitin Patel • Company Name: SetFocus• Date: 7/24/2009• Query Name:JobLabor04.mdx• Objective: 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 • */ • WITH MEMBER [Labor Hours] as• [Measures].[Hoursworked]

• SET [JobSet] as [Job Master].[Description].children

• set [TopThreeEmployees] as • GENERATE ( [JobSet]• ,[Job Master].[Description].currentMember• * TopCount([Employees].[Full Name].Children,• 3,[Labor Hours])) • SELECT [Labor Hours] on columns,• non empty[TopThreeEmployees] on rows• FROM [All Works]• WHERE [All Works Calendar].[Fy Year].&[2005]

MDX Samples

Page 23: Nitin\'s Business Intelligence Portfolio

• /*• AllWorks, Inc. - a Fictitious Construction Company• Developer: Nitin Patel • Company Name: SetFocus• Date: 7/24/2009• Query Name: JobSummary11.mdx• Objective: Retrieve all Clients with a Total Labor • cost to

date greater than 5,000, and • the word

'INC' appears in the client name • */

• SELECT [Measures].[Total Labor Cost] ON axis(0),• Filter ([Job Master].[Client Name].children,• [Measures].[Total Labor

Cost] > 5000 • AND Instr(1, [Job Master].[Client

Name].currentmember.name, • "INC") > 0)• on axis(1)• FROM [ALL WORKS]

• This query creates two lists using the Filter statement; the customers that are incorporated (“INC” in their name), and the customers that have been invoiced for Total Labor Costs more than $5000.

• These two lists are combined {Filtered Set} and only those customers that satisfy both sets of criteria are included in the report.

MDX Samples

Page 24: Nitin\'s Business Intelligence Portfolio

Calculated Members

• Here are some examples of Calculated Members that are in the cube. They can be used by Excel Services Pivot Tables, Reporting Services, other reporting tools, and in MDX queries.

• These Calculated Members, and others, were created primarily to simplify KPI expressions.

• An example of one Calculated Member is shown in the BIDS interface

screen shot below.

iif([Measures].[Invoice Amount] <> 0,

[Measures].[OpenReceivables]/[Measures].[Invoice Amount],-1)

Page 25: Nitin\'s Business Intelligence Portfolio

Screen shot of the Calculated Member Interface in BIDS

Calculated Members

Page 26: Nitin\'s Business Intelligence Portfolio

• Example - KPI Open Receivables • Open Receivables Percent as: (Invoice Amount – Amount Received) / (Amount

Received)

KPI’s, Trend Indicators, and Excel Services - Samples

Page 27: Nitin\'s Business Intelligence Portfolio

Excel Services was used to connect to the Analysis Services Cubes, and used the Pivot

Table Interface to create reports including KPI’s and Trend Indicators.

KPI’s, Trend Indicators, and Excel Services - Samples

Page 28: Nitin\'s Business Intelligence Portfolio

• Excel Services was used to connect to the Analysis Services Cubes, and used the Pivot Table Interface to create reports including KPI’s and Trend Indicators

. Screen Shot: KPI Open Receivables. This report shows clients, their invoice amount, and the amount received. If the open receivables are greater than 10%, show Red, between 5 and 10% show Yellow, and less than 5% show Green. There are a few clients that paid more than they were invoiced, so the KPI logic was extended to indicate a message to have someone verify the amounts. The Comment was automatically generated by using the Trend Indicator logic. If we received more than the client was invoiced, add the comment.

KPI’s, Trend Indicators, and Excel Services - Samples

Page 29: Nitin\'s Business Intelligence Portfolio

KPI’s, Trend Indicators, and Excel Services - Samples Screen Shot: KPI Quarter to Quarter Increase. This KPI only has Red and

Green indicators. If there are the same or more jobs per client this period, then Green (good). If there are less jobs, then Red (bad). If not jobs recorded for requested and previous quarter, then have no KPI indicator (Null). The Comment is automatically generated by using the Trend Indicator logic. If fewer jobs, add the comment.

Page 30: Nitin\'s Business Intelligence Portfolio

Screen Shot: This report shows regional sales and returns, and the percentage of returns vs sales. The KPI is based on the Returns Percentage; Less than 5% Green, 5-10% Yellow, and greater than 10% Red. The Trend indicator shows the trend as compared to last year; if a smaller percent of returns, then an Up Arrow (good). If the percent (rounded) is the same, then show a Right Arrow (OK). If a larger percent of returns than last year, then indicate a Down Arrow (bad).

KPI’s, Trend Indicators, and Excel Services - Samples

Page 31: Nitin\'s Business Intelligence Portfolio

SSRS Report: This is a report that uses Cascading Parameters before running the report. The

components of the report follow.

SSRS – Reporting Services

Page 32: Nitin\'s Business Intelligence Portfolio

The Report in Layout Mode (Design)

SSRS – Reporting Services