Successfully reported this slideshow.

Nitin\'s Business Intelligence Portfolio


Published on

  • Be the first to comment

  • Be the first to like this

Nitin\'s Business Intelligence Portfolio

  1. 1. Business Intelligence Portfolio Nitin Patel [email_address] 714-904-0359
  2. 2. Table of Contents <ul><ul><li>Project Overview 3 </li></ul></ul><ul><ul><li>T-SQL Samples 4 </li></ul></ul><ul><ul><li>MDX Samples 7 </li></ul></ul><ul><ul><li>SSIS – Integration Services 7 </li></ul></ul><ul><ul><li>SSAS – Analysis Services 12 </li></ul></ul><ul><ul><li>MDX Samples 14 </li></ul></ul><ul><ul><li>Calculated Members 17 </li></ul></ul><ul><ul><li>KPI’s, Trend Indicators, and Excel Services - 18 </li></ul></ul><ul><ul><li>Samples </li></ul></ul><ul><ul><li>SSRS – Reporting Services 21 </li></ul></ul><ul><ul><li>MOSS/PPS – Share Point and 24 </li></ul></ul><ul><ul><li>Performance Point Services </li></ul></ul>
  3. 3. Project Overview <ul><li>Sample Business Intelligence Project Work </li></ul><ul><li>This portfolio contains selected examples of my development skills in the Microsoft Business Intelligence arena. </li></ul><ul><li>Core technologies covered: </li></ul><ul><li>Microsoft SQL Server 2005 T-SQL </li></ul><ul><li>Microsoft SQL Server 2005 MDX </li></ul><ul><li>Microsoft SQL Server 2005 </li></ul><ul><li>Microsoft SQL Server 2005 Integration Services (SSIS) </li></ul><ul><li>Microsoft SQL Server 2005 Analysis Services (SSAS) </li></ul><ul><li>Microsoft SQL Server 2005 Reporting Services (SSRS) </li></ul><ul><li>Microsoft Office SharePoint Server 2007 (MOSS) </li></ul><ul><li>Microsoft Office Performance Point Server (PPS) </li></ul><ul><li>Introduction: Project Summary </li></ul><ul><li>Design and build a Business Intelligence solution for a simulated construction company to track employee, customer, job order, and timesheet information. </li></ul>
  4. 4. <ul><li>Define a Star Schema database using Visio (four fact tables) </li></ul><ul><li>Create a Staging Database (Visio created the DDL) </li></ul><ul><li>Create an ETL solution to update the SQL Server 2005 database from Excel and flat file sources using SSIS </li></ul><ul><li>Create a Star Schema Analysis Services cube with SSAS </li></ul><ul><li>Write MDX queries based on specifications </li></ul><ul><li>Define Calculated Members and business Key Performance Indicators (KPIs) in SSAS </li></ul><ul><li>Use Excel Services 2007 to display the cube data and the KPIs, displaying statuses and trends </li></ul><ul><li>Produce detail and summary reports using SSRS </li></ul><ul><li>Create score cards using MS Office Performance Point </li></ul><ul><li>Implement business intelligence dashboards using MOSS 2007 (SharePoint </li></ul>Project Overview
  5. 5. T-SQL Samples <ul><li>/* Nitin Patel </li></ul><ul><li>Query to Join Three tables and display CategoryName, </li></ul><ul><li>ShipName, and OrderDollars </li></ul><ul><li>*/ </li></ul>
  6. 6. <ul><li>/* Nitin Patel </li></ul><ul><li>Query using Common Table Expression and Cross Join </li></ul><ul><li>*/ </li></ul>
  7. 7. <ul><li>/* Nitin Patel </li></ul><ul><li>Query using Ties and Rank </li></ul><ul><li>*/ </li></ul>
  8. 8. <ul><li>/* Nitin Patel </li></ul><ul><li>Query using Rollup </li></ul><ul><li>*/ </li></ul>
  9. 9. <ul><li>Integration Services </li></ul><ul><li>Create packages to transfer the data from different raw data sources (Excel, CSV). Data sources are both normalized and non-normalized. </li></ul><ul><li>Do a full load of data into MS SQL Server 2005. </li></ul><ul><li>Run scheduled packages nightly to import/update any additional information. </li></ul><ul><li>Perform validation to detect errors (e.g. child records with invalid parent records). </li></ul><ul><li>Generate emails with the results, including rows inserted, updated. Errors are redirected to log files which become email attachments. </li></ul><ul><li>Create a separate package to re-index and shrink the database, as well as perform nightly backups of the database. </li></ul><ul><li>Screenshots: </li></ul><ul><li>This particular package required reading multiple CSV files and totaling record counts for all files. </li></ul><ul><li>Following are the control flow and data flow screenshots. </li></ul><ul><li>Control flow for a package </li></ul>SSIS – Integration Services
  10. 10. SSIS – Integration Services
  11. 11. <ul><li>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. </li></ul>SSIS – Integration Services
  12. 12. SSIS – Integration Services
  13. 13. <ul><li>Sample email with error information including date and time. </li></ul>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.
  14. 14. <ul><li>Control Flow </li></ul>SSIS – Integration Services
  15. 15. <ul><li>Data flow gets repeated for each source file in the source directory. </li></ul>SSIS – Integration Services
  16. 16. <ul><li>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. </li></ul><ul><li>After the database is completely loaded, some maintenance tasks are executed – the database is re-indexed, backed-up, and compressed. </li></ul><ul><li>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. </li></ul>SSIS – Integration Services
  17. 17. <ul><li>Design the Data Source View using BIDS </li></ul><ul><li>Restore the All Works Database from the Backup file. </li></ul><ul><li>Create the four fact tables from the scripts provided by the DBA. </li></ul><ul><li>Create the calendar table (AllWorksCalendar) from the script provided by the DBA. </li></ul><ul><li>Establish database connection. </li></ul><ul><li>Use “Service Account” for login credentials. </li></ul><ul><li>Select the tables that we will use, including the fact tables and the dimension tables. </li></ul><ul><li>All tables are indicated in the screen shot that follows. </li></ul><ul><li>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. </li></ul>SSAS – Analysis Services
  18. 18. <ul><li>n </li></ul>SSAS – Analysis Services Here is the DSV Diagram
  19. 19. <ul><li>Design the Cube using BIDS </li></ul><ul><li>Utilize the Cube Wizard to build the All Works Cube </li></ul><ul><li>Automatically create attributes and hierarchies </li></ul><ul><li>Verify that the Fact tables and Dimension Tables properly identified </li></ul><ul><li>Verify measures by measure group </li></ul><ul><li>Verify dimensions </li></ul><ul><li>Name cube and finish </li></ul><ul><li>Use dimension Usage to verify dimensions used in each fact table </li></ul><ul><li>Edit AllWorksCalendar dimension – rename levels and create hierarchy </li></ul>SSAS – Analysis Services
  20. 20. <ul><li>Here is the Cube Design and Dimension Editor: </li></ul>
  21. 21. <ul><li>/* </li></ul><ul><li>AllWorks, Inc. - a Fictitious Construction Company </li></ul><ul><li>Developer: Nitin Patel </li></ul><ul><li>Company Name: SetFocus </li></ul><ul><li>Date: 7/24/2009 </li></ul><ul><li>Query Name: JobLabor05.mdx </li></ul><ul><li>Objective: Show All employees for 2005 Q4, and four periods ago, </li></ul><ul><li> for total hours worked in the Quarter. </li></ul><ul><li>*/ </li></ul><ul><li>WITH MEMBER [Measures].[Total Hours YagoUT] AS </li></ul><ul><li>([Measures].[Hoursworked], </li></ul><ul><li>PARALLELPERIOD([All Works Calendar].[Fy Year - Fy Qtr].[Fy Qtr] </li></ul><ul><li>, 4)) </li></ul><ul><li>M ember [Measures].[Total Hours Yago] as </li></ul><ul><ul><li>iif([Measures]. </li></ul></ul><ul><ul><li>[Total Hours YagoUT], </li></ul></ul><ul><ul><li>[Measures].[Total Hours YagoUT],0) </li></ul></ul><ul><li>M ember [Measures].[CleanHoursworked] as </li></ul><ul><li>iif ([Measures].[Hoursworked],[Measures].[Hoursworked],0) </li></ul><ul><li>SELECT non empty{[Measures].[CleanHoursworked], </li></ul><ul><li>[Measures].[Total Hours Yago]} ON columns, </li></ul><ul><li>non empty [Employees].[Full Name].members ON rows </li></ul><ul><li>FROM [All Works] </li></ul><ul><li>WHERE [All Works Calendar].[2005 Q4] </li></ul>MDX Samples
  22. 22. <ul><li>/* </li></ul><ul><li>AllWorks, Inc. - a Fictitious Construction Company </li></ul><ul><li>Developer: Nitin Patel </li></ul><ul><li>Company Name: SetFocus </li></ul><ul><li>Date: 7/24/2009 </li></ul><ul><li>Query Name: JobLabor04.mdx </li></ul><ul><li>Objective: For 2005, show the job and the top three </li></ul><ul><li>employees who worked the most hours. </li></ul><ul><li>Show the jobs in job order, </li></ul><ul><li>and within the job show the employees </li></ul><ul><li>in hours worked order </li></ul><ul><li>*/ </li></ul><ul><li>WITH MEMBER [Labor Hours] as </li></ul><ul><li>[Measures].[Hoursworked] </li></ul><ul><li>SET [JobSet] as [Job Master].[Description].children </li></ul><ul><li>set [TopThreeEmployees] as </li></ul><ul><li>GENERATE ( [JobSet] </li></ul><ul><li>,[Job Master].[Description].currentMember </li></ul><ul><li>* TopCount([Employees].[Full Name].Children, </li></ul><ul><li>3,[Labor Hours])) </li></ul><ul><li>SELECT [Labor Hours] on columns, </li></ul><ul><li>non empty[TopThreeEmployees] on rows </li></ul><ul><li>FROM [All Works] </li></ul><ul><li>WHERE [All Works Calendar].[Fy Year].&[2005] </li></ul>MDX Samples
  23. 23. <ul><li>/* </li></ul><ul><li>AllWorks, Inc. - a Fictitious Construction Company </li></ul><ul><li>Developer: Nitin Patel </li></ul><ul><li>Company Name: SetFocus </li></ul><ul><li>Date: 7/24/2009 </li></ul><ul><li>Query Name: JobSummary11.mdx </li></ul><ul><li>Objective: Retrieve all Clients with a Total Labor </li></ul><ul><li>cost to date greater than 5,000, and </li></ul><ul><li>the word 'INC' appears in the client name </li></ul><ul><li>*/ </li></ul><ul><li>SELECT [Measures].[Total Labor Cost] ON axis(0), </li></ul><ul><li>Filter ([Job Master].[Client Name].children, </li></ul><ul><li>[Measures].[Total Labor Cost] > 5000 </li></ul><ul><li>AND Instr(1, [Job Master].[Client Name], </li></ul><ul><li> &quot;INC&quot;) > 0) </li></ul><ul><li>on axis(1) </li></ul><ul><li>FROM [ALL WORKS] </li></ul><ul><li>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. </li></ul><ul><li>These two lists are combined {Filtered Set} and only those customers that satisfy both sets of criteria are included in the report. </li></ul>MDX Samples
  24. 24. Calculated Members <ul><li>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. </li></ul><ul><li>These Calculated Members, and others, were created primarily to simplify KPI expressions. </li></ul><ul><li>An example of one Calculated Member is shown in the BIDS interface screen shot below. </li></ul><ul><ul><li>iif([Measures].[Invoice Amount] <> 0, </li></ul></ul><ul><ul><li>[Measures].[OpenReceivables]/[Measures].[Invoice Amount],-1) </li></ul></ul>
  25. 25. Calculated Members Screen shot of the Calculated Member Interface in BIDS
  26. 26. <ul><li>Example - KPI Open Receivables </li></ul><ul><li>Open Receivables Percent as: (Invoice Amount – Amount Received) / (Amount Received) </li></ul>KPI’s, Trend Indicators, and Excel Services - Samples
  27. 27. <ul><li>Excel Services was used to connect to the Analysis Services Cubes, and used the Pivot </li></ul><ul><li>Table Interface to create reports including KPI’s and Trend Indicators. </li></ul>KPI’s, Trend Indicators, and Excel Services - Samples
  28. 28. <ul><li>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 </li></ul><ul><li>. 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. </li></ul>KPI’s, Trend Indicators, and Excel Services - Samples
  29. 29. KPI’s, Trend Indicators, and Excel Services - Samples <ul><li>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. </li></ul>
  30. 30. <ul><li>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). </li></ul>KPI’s, Trend Indicators, and Excel Services - Samples
  31. 31. <ul><li>SSRS Report: This is a report that uses Cascading Parameters before running the report. The </li></ul><ul><li>components of the report follow. </li></ul>SSRS – Reporting Services
  32. 32. <ul><li>The Report in Layout Mode (Design) </li></ul>SSRS – Reporting Services