SSAS Project Profile

590 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
590
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

SSAS Project Profile

  1. 1. Business IntelligenceSSAS Development Terry Thompson<br />Introduction:<br />For phase II of the Business Intelligence project I was responsible developing a Microsoft SQL Services Analysis Services (SSAS) solution in BIDS that involved creation of a cube from four Fact tables for use in development of MDX queries and KPI reporting solutions.<br />Project Goals:<br /><ul><li>Standard named Views and Cubes for easier query and reporting development
  2. 2. Modified relationships in the Data Source View to support the required reporting structures
  3. 3. Required hierarchies with meaningful naming conventions created in dimensions to support required reporting
  4. 4. Partitioning of the fact tables to enhance query performance
  5. 5. Efficient MDX query development with standard and meaningful script documentation and easy code readability
  6. 6. Development of 5 KPIs using BIDS Calculated members and KPI functions reported in Excel.</li></ul> Data Source view generated from Database selecting following tables.<br /><ul><li>JobSummaryFactsCountyJobOverheadSummaryFactsDivisionJobMaterialFactsEmployeesJobLaborFactsJobMasterAllWorksCalendarMaterial TypeClientsOverheadClientGroupings</li></ul>In the Data Source view, created the following relationships:<br /><ul><li>Allworks Calendar targeted for 4 relationships on Week ending Date from JobOverheadSummaryFacts, JobMaterialFacts, and JobLaborFacts (on week ending date) and JobSummaryFacts (on JobClosedDate)
  7. 7. Employees target of relationship from JobLaborFacts (on EmployeePK)
  8. 8. MaterialTypes target of relationship from JobMaterialFacts (on MaterialTypePK)
  9. 9. Overhead target of relationship from (JobOverheadSummaryFacts (on OverheadPK)
  10. 10. JobMasterPK is target of 4 relationships from JobOverheadSummaryFacts, JobMaterialFacts, JobLaborFacts, and JobSummaryFacts (all on JobMasterPK)
  11. 11. JobMasterPK is related to Clients, on ClientPK
  12. 12. Clients is related to County, which in turn is related to Division (based on CountypK, and DivisionPK)
  13. 13. Clients is related to ClientGroupings, on ClientGroupingPK</li></ul>Create a cube and dimensions using the cube wizard. <br /><ul><li> one cube with four fact tables
  14. 14. Five dimensions</li></ul>Dimension Hierarchies<br />Use of the NameColumn property was set for each hierarchy levels to display the appropriate description instead of the integer key values (e.g. DivisionName).<br />Partitioning was implemented based on year to enhance performance. <br />Sample Archived Source Query: Pre 2005 data<br />SELECT [dbo].[JobSummaryFacts].[JobMasterPK],[dbo].[JobSummaryFacts].[Description]<br />,[dbo].[JobSummaryFacts].[ClientPK],[dbo].[JobSummaryFacts].[HoursWorked]<br />,[dbo].[JobSummaryFacts].[TotalLaborCost],[dbo].[JobSummaryFacts].[TotalLaborProfit]<br />,[dbo].[JobSummaryFacts].[TotalOverhead],[dbo].[JobSummaryFacts].[TotalMaterialCost]<br />,[dbo].[JobSummaryFacts].[TotalMaterialProfit],[dbo].[JobSummaryFacts].[AdditionalLaborProfit]<br />,[dbo].[JobSummaryFacts].[InvoiceAmount],[dbo].[JobSummaryFacts].[AmountReceived]<br />,[dbo].[JobSummaryFacts].[JobClosedDate]<br />FROM [dbo].[JobSummaryFacts] <br />join [dbo].[AllWorksCalendar] <br />on ([dbo].[JobSummaryFacts].[JobClosedDate] = [dbo].[AllWorksCalendar].[WeekEndDate])<br />where [dbo].[AllWorksCalendar].[FyYear] < '2005'<br />A sample of MDX Queries developed utilizing the cube, measures and dimensions generated by the SSAS solution. <br />Query 1:<br />Retrieve and calculate the total costs, the total profit, and total profit %, for each individual job.<br /> <br />The three are calculated as follows:<br /> Total costs = total labor cost + total material cost + total overhead cost<br /> Total profit = labor profit + material profit + additional labor overhead<br /> profit<br /> Total profit % = (total profit / (total cost + total profit)) <br />Company: Setfocus<br />Author: Terry Thompson<br />Create Date: 6/15/2009<br />With<br />member [Total Costs] as<br />([Measures].[Total Labor Cost]+ [Measures].[Total Material Cost]+[Measures].[Total Overhead]), solve_order = 10<br />Member [Total Profit] as <br />([Measures].[Total Labor Profit]+[Measures].[Total Material Profit]+[Measures].[Additional Labor Profit]), solve_order = 20<br />Member [ProfitPCT] as <br />iif(([Total Costs] + [Total Profit]),([Total Profit] / ([Total Costs] + [Total Profit])),1) <br />, solve_order = 30, format_string = 'Percent'<br />Set [MemberSet] as ({[Total Costs],[Total Profit],[ProfitPCt]})<br /> <br />Select [MemberSet]<br />on columns,<br />non empty filter ([Job Master].[Description].members,<br />([Total Costs] + [Total Profit]) > 0)<br />on rows<br />From [All Works]<br />Query 2:<br />Show Overhead by Overhead Category for Q3 and Q4 2005,<br />and also show the % of change between the two<br />Company: SetFocus<br />author: Terry THompson<br />Create Date: 6/15/2009<br />with<br />Member [2005 Q4] as<br />([Measures].[Weekly Over Head], [All Works Calendar].[Fy Year - Fy Qtr].[Fy Year].&[2005].&[2005 Q4]), solve_order = 10<br />Member [2005 Q3] as <br />([Measures].[Weekly Over Head], [All Works Calendar].[Fy Year - Fy Qtr].[Fy Year].&[2005].&[2005 Q3]), solve_order = 20<br />member [PctChg] as <br />(iif (( [2005 Q3] > 0), (([2005 Q4]/[2005 Q3]) - 1)," N/A" )<br />), solve_order = 30, format_string = 'percent'<br />set [columnset] as ({[2005 Q4], [2005 Q3], [PctChg]})<br />Select [columnset]<br />on columns,<br />[Overhead].[Description].members<br />on rows<br />from [All works]<br />Query 3:<br />Show jobs in order of purchase amount and then show the<br />breakdown in each job of material type (for instance, <br />Job A, total purchase amount, amount for fuel, amount for materials,<br />amount for petty cash, etc.)<br />The general order should be by total purchase amount, so that the top of the result set shows the jobs that required the highest purchase amounts <br />Company: SetFocus<br />Author: Terry Thompson<br />Create Date: 6/15/2009<br />with<br />member [Material Purchases] as<br />[Measures].[Purchase Amount], format_string = " Currency" <br />set [JobSet] as<br />order ([Job Master].[Description].children, [Material Purchases], desc)<br />select [Material Purchases]<br />on columns,<br />non empty [JobSet] * [Material Types].[Description].members<br />on rows<br />from [All Works]<br />Query 4:<br />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 <br />Company: SetFocus<br />Author: Terry Thompson<br />Create Date: 6/16/2009<br />With<br />set [GenSet] as<br />Generate (<br />[Job Master].[Description].children,<br />crossjoin (<br />{[Job Master].[Description].currentmember},<br />topcount (<br /> [Employees].[Full Name].children,<br /> 3,<br />[Measures].[Hoursworked]<br />)<br />)<br />)<br />Select [Measures].[Hoursworked]<br />on columns,<br />non empty [genset]<br />on rows<br />From [All Works]<br />where [All Works Calendar].[Fy Year].&[2005]<br />KPI Development<br />The following KPI reports the percent increase in overhead category of total costs from one quarter to the next. (Total Overhead divided by Total Job Costs). Two calculated members were created in the Cube prior to building KPI. <br />Total costs Percent of Overhead <br />KPI Creation and Reporting<br />The calculated member for percent of overhead is evaluated against the KPI goal of 10%. The status indicator for the KPI reporting will be a Traffic Light. The indicators will be set based on the following guidelines. <br /><ul><li>Greater than 15% then Red (BAD)
  15. 15. Greater than 10% and less than or equal to 15% then yellow (Warning)
  16. 16. Less than 10% then green (Good) desired range</li></ul>KPI Excel Report using Pivot Table Formatting<br />Percent overhead from Q2, 2006 to Q1, 2006.<br />

×