1. Carmen Faber MBA, OCP Wharton, NJ carmenfaber@gmail.com Business Intelligence Suite Developer 1 Is Business Intelligence in Your Business?
2. Portfolio Overview This portfolio contains selected examples of my development skills using Microsoft Business Intelligence SSAS and Sample MDX using BIDS SSAS using Microsoft Visual Studio page 3-20 MDX – Multi-Dimensional Queries Cube Structure Various sample Queries - page 21-43 Data Source View Dimension Usage Job Master Dimension Structure / Hierarchy Sample SSAS Calculation Calculation – Open Receivable Percent of Inventory Calculation – Total Cost Calculation - Overhead Percent of Total Cost Calculation - Total Profit Calculation - Profit Percent Calculation - Job Increase Calculation - Overhead Percent Increase Sample SSAS KPIs KPI Open Receivable KPI Job Increase KPI Profit Percent KPI Overhead Percent Increase KPI Profit Percent Partitions Perspective Test using Browser 2 Is Business Intelligence in Your Business?
3. SSAS Project All Works Cube (Measures/Fact and Dimension) 3 Is Business Intelligence in Your Business?
4. SSAS Project Data Source View 4 Is Business Intelligence in Your Business?
6. SSAS Project – Job Master Dimension Structure / Hierarchy 6 Is Business Intelligence in Your Business?
7. SSAS Project – Calculation – Open Receivable Percent of Inventory CASE WHEN [Measures].[Invoice Amount] = 0 THEN -1. ELSE ([Measures].[Invoice Amount]-[Measures].[Amount Received])/[Measures].[Invoice Amount] END 7 Is Business Intelligence in Your Business?
8. SSAS Project – Calculation – Total Cost [Measures].[Total Overhead] + [Measures].[Total Material Cost]+ [Measures].[Total Labor Cost] 8 Is Business Intelligence in Your Business?
9. SSAS Project – Overhead Percent of Total Cost CASE WHEN [Measures].[Total Overhead] / [Measures].[TotalCost] = 0 THEN 0 ELSE [Measures].[Total Overhead] / [Measures].[TotalCost] END 9 Is Business Intelligence in Your Business?
10. SSAS Project – Total Profit [Measures].[Total Labor Profit] + [Measures].[Total Material Profit] +[Measures].[Additional Labor Profit] 10 Is Business Intelligence in Your Business?
11. SSAS Project – Profit Percent CASE WHEN [Measures].[TotalCost] = 0 THEN '100%' ELSE [Measures].[TotalProfit] / ([Measures].[TotalCost] +[Measures].[TotalProfit]) END 11 Is Business Intelligence in Your Business?
12. SSAS Project – Job Increase [Measures].[Job Summary Facts Count] - ([Measures].[Job Summary Facts Count] , ParallelPeriod ([Fy Qtr].[Fy Qtr], 1)) 12 Is Business Intelligence in Your Business?
13. SSAS Project – Overhead Percent Increase CASE WHEN ([Measures].[Weekly Over Head] , ParallelPeriod ([Fy Qtr].[Fy Qtr], 1)) = 0 THEN 1 ELSE ([Measures].[Weekly Over Head] - ([Measures].[Weekly Over Hea d] , ParallelPeriod ([Fy Qtr].[Fy Qtr], 1))) /([Measures].[Weekly Over Head] , ParallelPeriod ([Fy Qtr].[Fy Qtr], 1)) END 13 Is Business Intelligence in Your Business?
14. SSAS Project – KPI Open Receivable CASE WHEN KPIVALUE("KPIOpenReceivable") <= KPIGOAL( "KPIOpenReceivable") THEN 1 WHEN KPIVALUE("KPIOpenReceivable")>= KPIGOAL( "KPIOpenReceivable") AND KPIVALUE("KPIOpenReceivable")<= KPIGOAL( "KPIOpenReceivable") * 2 THEN 0 WHEN KPIVALUE("KPIOpenReceivable")> KPIGOAL( "KPIOpenReceivable")* 2 THEN -1 END 14 Is Business Intelligence in Your Business?
15. SSAS Project – KPI Job Increase CASE WHEN KPIVALUE("KPIJobIncrease") >= KPIGOAL( "KPIJobIncrease") THEN 1 WHEN KPIVALUE("KPIJobIncrease") < KPIGOAL( "KPIJobIncrease") THEN -1 END 15 Is Business Intelligence in Your Business?
16. SSAS Project – KPI Profit Percent CASE WHEN KPIVALUE("KPIProfitPercent") > KPIGOAL( "KPIProfitPercent") THEN 1 WHEN KPIVALUE("KPIProfitPercent") >= (KPIGOAL( "KPIProfitPercent")/3) AND KPIVALUE("KPIProfitPercent") <= KPIGOAL( "KPIProfitPercent") THEN 0 WHEN KPIVALUE("KPIProfitPercent") < (KPIGOAL( "KPIProfitPercent")/ 3) THEN -1 END 16 Is Business Intelligence in Your Business?
17. SSAS Project – KPI Overhead Percent Increase CASE WHEN KPIVALUE("KPIOverheadPercentIncrease") <= KPIGOAL( "KPIOverheadPercentIncrease") THEN 1 WHEN KPIVALUE("KPIOverheadPercentIncrease") >= KPIGOAL( "KPIOverheadPercentIncrease") AND KPIVALUE("KPIOverheadPercentIncrease") <= KPIGOAL( "KPIOverheadPercentIncrease") * 1.5 THEN 0 WHEN KPIVALUE("KPIOverheadPercentIncrease") > KPIGOAL( "KPIOverheadPercentIncrease") * 1.5 THEN -1 END 17 Is Business Intelligence in Your Business?
18. SSAS Project – Partitions 18 Is Business Intelligence in Your Business?
19. SSAS Project – Perspective 19 Is Business Intelligence in Your Business?
20. SSAS Project – Test using Browser 20 Is Business Intelligence in Your Business?
21. MDX – Multi-Dimensional Queries List Hours Worked and Total Labor for each employee for 2005, -- along with the labor rate (Total labor / Hours worked). WITH MEMBER[LaborRate] AS ([Total Labor] / [Hoursworked]) SELECT {[Hoursworked],[Total Labor], [LaborRate]} ON COLUMNS, NON EMPTY( [Employees].[Full Name].members) ON ROWS FROM [All WorksCube] WHERE [Fy Year].[2005] 21 Is Business Intelligence in Your Business?
22. MDX – Multi-Dimensional Queries Retrieve total labor costs by County SELECT [Measures].[Total Labor Cost]ON COLUMNS, non empty([Job Master].[County Name].members) ON ROWS FROM [All WorksCube] 22 Is Business Intelligence in Your Business?
23. MDX – Multi-Dimensional Queries Retrieve total labor costs by Division SELECT [Measures].[Total Labor Cost]ON COLUMNS, non empty([Job Master].[Division Name].members) ON ROWS FROM [All WorksCube] 23 Is Business Intelligence in Your Business?
24. MDX – Multi-Dimensional Queries Retrieve total labor costs by Client Account grouping SELECT [Measures].[Total Labor Cost]ON COLUMNS, non empty([Job Master].[Client Groupings].members) ON ROWS FROM [All WorksCube] 24 Is Business Intelligence in Your Business?
25. MDX – Multi-Dimensional Queries Retrieve 3 meatures…total labor cost, total material cost, and total overhead by client SELECT {[Total Labor Cost], [Total Material Cost], [Total Overhead]}ON COLUMNS, non empty([Job Master].[Client Name].MEMBERS) ON ROWS FROM [All WorksCube] 25 Is Business Intelligence in Your Business?
26. MDX – Multi-Dimensional Queries Retrieve 3 meatures…total labor cost, total material cost, and total overhead by client Do the same (retrieve 3 measures) and add a 4th measure, -- a calculated measure, that adds all three costs WITH MEMBER [AllCosts] AS [Total Labor Cost]+ [Total Material Cost]+ [Total Overhead] SELECT {[Total Labor Cost], [Total Material Cost], [Total Overhead], [AllCosts]}ON COLUMNS, non empty([Job Master].[Client Name].MEMBERS) ON ROWS FROM [All WorksCube] 26 Is Business Intelligence in Your Business?
27. MDX – Multi-Dimensional Queries Retrieve and calculate the total costs, the total profit, and total profit %, for each individual job. The three are calculated as follows: -- Total costs = total labor cost + total material cost + total overhead cost -- Total profit = labor profit + material profit + additional labor overhead profit -- Total profit % = (total profit / (total cost + total profit)) * 100 WITH MEMBER [TotalCosts] AS [Total Labor Cost]+ [Total Material Cost]+ [Total Overhead] MEMBER [TotalProfit] AS [Total Labor Profit]+ [Total Material Profit]+ [Additional Labor Profit] MEMBER [ProfitPct] AS ([TotalProfit] / ([TotalCosts]+[TotalProfit]) ) , format_string = 'percent‘ SELECT {[TotalCosts], [TotalProfit], [ProfitPct] }ON COLUMNS, NON EMPTY ([Job Master].[Description].members) HAVING [ProfitPct] > 0 ON ROWS FROM [All WorksCube] 27 Is Business Intelligence in Your Business?
28. MDX – Multi-Dimensional Queries Retrieve and calculate the total costs, the total profit, and total profit %, for each individual job. The three are calculated as follows: -- Total costs = total labor cost + total material cost + total overhead cost -- Total profit = labor profit + material profit + additional labor overhead profit -- Total profit % = (total profit / (total cost + total profit)) * 100 Do the same thing as above, but group it by client WITH MEMBER [TotalCosts] AS [Total Labor Cost]+ [Total Material Cost]+ [Total Overhead] MEMBER [TotalProfit] AS [Total Labor Profit]+ [Total Material Profit]+ [Additional Labor Profit] MEMBER [ProfitPct] AS ([TotalProfit] / ([TotalCosts]+[TotalProfit]) ) , format_string = 'percent' SELECT {[TotalCosts], [TotalProfit], [ProfitPct] }ON COLUMNS, NON EMPTY ([Job Master].[Client Name].members) ON ROWS FROM [All WorksCube] 28 Is Business Intelligence in Your Business?
29. MDX – Multi-Dimensional Queries Display a count of Jobs by Client in alphabetical order. Display NULLs as 0. WITH MEMBER [JobSummaryFactsCount] as IIF ([MEASURES].[Job Summary Facts Count] > 0, [MEASURES].[Job Summary Facts Count], 0) SELECT [JobSummaryFactsCount] ON COLUMNS, [Job Master].[Client Name].MEMBERS ON ROWS FROM [All WorksCube] 29 Is Business Intelligence in Your Business?
30. MDX – Multi-Dimensional Queries Retrieve all Clients with a Total Labor cost to date greater than 5,000, and the word 'INC' appears in the client name SELECT [Total Labor Cost]ON COLUMNS, filter([Job Master].[Client Name].CHILDREN, Instr([Job Master].[Client Name].CurrentMember.Name, "INC") AND [Total Labor Cost]> 5000 ) ON ROWS FROM [All WorksCube] 30 Is Business Intelligence in Your Business?
31. MDX – Multi-Dimensional Queries List the jobs that make up the top 30% of total invoice amount Select [Measures].[Invoice Amount] on columns, TopPercent([Job Master].[Job Master].children, 30,[Measures].[Invoice Amount]) on Rows from[All WorksCube] 31 Is Business Intelligence in Your Business?
32. MDX – Multi-Dimensional Queries Show Overhead by Overhead Category for Q3 and Q4 2005 (hint, use the FY Qtr as a dimension) SELECT {[Fy Qtr].[2005 Q3], [Fy Qtr].&[2005 Q4]} ON COLUMNS, non empty ([Overhead].[Overhead].MEMBERS) ON ROWS FROM [All WorksCube] WHERE [Weekly Over Head] 32 Is Business Intelligence in Your Business?
33. MDX – Multi-Dimensional Queries Show Overhead by Overhead Category for Q3 and Q4 2005, and also show the % of change between the two) WITH member [ovheadCurrentPeriod] as ([Measures].[Weekly Over Head], [Fy Qtr].currentmember) member [ovheadPriorPeriod] as ([Measures].[Weekly Over Head], [Fy Qtr].prevmember) member [PctofCHG] AS iif([ovheadPriorPeriod], ([ovheadCurrentPeriod] - [ovheadPriorPeriod])/ [ovheadPriorPeriod], null), format_string = '0.00%;;;/A' SELECT {[ovheadCurrentPeriod], [ovheadPriorPeriod], [PctofCHG] } ON COLUMNS, non empty([Overhead].[Description].MEMBERS) ON ROWS FROM [All WorksCube] WHERE [Fy Qtr].[2005 Q4] 33 Is Business Intelligence in Your Business?
34. MDX – Multi-Dimensional Queries Show Overhead by Overhead Category for all of 2005, order by Overhead $$ amount descending WITH SET [OrderOverhead] AS ORDER([Overhead].[Overhead].MEMBERS, [Weekly Over Head], DESC) SELECT [Weekly Over Head] ON COLUMNS, non empty ( [OrderOverhead]) ON ROWS FROM [All WorksCube] WHERE [Fy Year].[2005] 34 Is Business Intelligence in Your Business?
35. MDX – Multi-Dimensional Queries Show Material Purchase amounts by Material Type for 2005. The result set should have 1 column for the purchase amounts for Fuel, Materials, and petty Cash SELECT [Purchase Amount] ON COLUMNS, [Material Types].[Description].members ON ROWS FROM [All WorksCube] 35 Is Business Intelligence in Your Business?
36. MDX – Multi-Dimensional Queries Show Material purchase amounts for 2005, broken out by Material Purchase type and client. (for instance, Fuel for client A, B, C…Petty Cash for client A, B, C, etc.) Display NULLs as $0.00 WITH MEMBER [PurchaseAmt] as IIF ([MEASURES].[Purchase Amount] > 0, [Purchase Amount], 0), format_string = 'currency' SELECT [PurchaseAmt] ON COLUMNS, ([Material Types].[Description].children, [Client Name].children) ON ROWS FROM [All WorksCube] WHERE [Fy Year].[2005] 36 Is Business Intelligence in Your Business?
37. MDX – Multi-Dimensional Queries Show a list of total client material purchases for 2005, in descending purchase amount order. The result set should show at the top which client required the most materials. WITH SET [OrderClientPurchAmt] AS order( [Client Name].children, [Purchase Amount], desc) SELECT [Purchase Amount] ON COLUMNS, non empty ( [OrderClientPurchAmt] ) ON ROWS FROM [All WorksCube] WHERE [Fy Year].[2005] 37 Is Business Intelligence in Your Business?
38. MDX – Multi-Dimensional Queries -- Show jobs in order of purchase amount and then show the -- breakdown in each job of material type (for instance, Job A, total purchase amount, amount for fuel, amount for materials, amount for petty cash, etc.) 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 WITH SET [OrderedJOB] AS ORDER( [Job Master].[Job Master].CHILDREN, [Purchase Amount], desc) MEMBER [PurchaseAmt] AS IIF ([Purchase Amount]> 0, [Purchase Amount], 0), format_string = 'currency' SELECT [PurchaseAmt] ON COLUMNS, ([OrderedJOB], [Material Types].[Description].members) ON ROWS FROM [All WorksCube] 38 Is Business Intelligence in Your Business?
39. MDX – Multi-Dimensional Queries List Hours Worked and Total Labor for each employee for 2005, along with the labor rate (Total labor / Hours worked). WITH MEMBER[LaborRate] AS ([Total Labor] / [Hoursworked]) SELECT {[Hoursworked],[Total Labor], [LaborRate]} ON COLUMNS, NON EMPTY( [Employees].[Full Name].members) ON ROWS FROM [All WorksCube] WHERE [Fy Year].[2005] 39 Is Business Intelligence in Your Business?
40. MDX – Multi-Dimensional Queries 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. WITH MEMBER[LaborRate] AS ([Total Labor] / [Hoursworked]) SELECT {[Hoursworked],[Total Labor], [LaborRate]} ON COLUMNS, NON EMPTY( ORDER ([Employees].[Full Name].members, [LaborRate], bDESC) ) ON ROWS FROM [All WorksCube] WHERE [Fy Year].[2005] 40 Is Business Intelligence in Your Business?
41. MDX – Multi-Dimensional Queries For 2005, show Total Hours worked, total labor dollars, and total labor rate for contractors (employee flag is false) and employees (employee flag is true) WITH MEMBER[LaborRate] AS ([Total Labor] / [Hoursworked]) SELECT {[Hoursworked],[Total Labor], [LaborRate]} ON COLUMNS, non empty ([Employees].[Employee Flag].members) ON ROWS FROM [All WorksCube] WHERE [Fy Year].[2005] 41 Is Business Intelligence in Your Business?
42. MDX – Multi-Dimensional Queries 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 SET [JobTop3emp] AS GENERATE( [Job Master].[Description].children , ([Job Master].[Description].currentmember, topcount( [Employees].[Employees].children, 3, [Hoursworked]) ) ) SELECT [Hoursworked] ON COLUMNS, non empty ( [JobTop3emp] ) ON ROWS FROM [All WorksCube] WHERE [Fy Year].[2005] 42 Is Business Intelligence in Your Business?
43. MDX – Multi-Dimensional Queries Show All employees for 2005 Q4, and four periods ago, -- for total hours worked in the Quarter -- Display NULLs as 0 with member [HrsWrkParamWhereCLausewhichisQ42005] as IIF ( ([Fy Qtr].currentmember,[Measures].[Hoursworked] ) > 0, ([Fy Qtr].currentmember,[Measures].[Hoursworked] ), 0) member [HrsWrk4PeriodsAgo] as IIF ( ([Measures].[Hoursworked] , ParallelPeriod ([Fy Qtr].[Fy Qtr], 4)) > 0, ([Measures].[Hoursworked] , ParallelPeriod ([Fy Qtr].[Fy Qtr], 4)), 0) SELECT { [HrsWrk4PeriodsAgo] , [HrsWrkParamWhereCLausewhichisQ42005]} ON COLUMNS, [Employees].[Full Name].children ON ROWS FROM [All WorksCube] WHERE [Fy Qtr].[2005 Q4] 43 Is Business Intelligence in Your Business?
44. Thank you for Your Time I hope you enjoyed your few minutes of viewing what took intense months of training to accomplished 44 Is Business Intelligence in Your Business?