• Save
Business intelligence portfolio
Upcoming SlideShare
Loading in...5
×
 

Business intelligence portfolio

on

  • 357 views

 

Statistics

Views

Total Views
357
Views on SlideShare
350
Embed Views
7

Actions

Likes
0
Downloads
0
Comments
0

1 Embed 7

http://www.linkedin.com 7

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Business intelligence portfolio Business intelligence portfolio Presentation Transcript

  • By
    Brian Grewal
    Business Intelligence Portfolio
  • Extract
    Transform
    Load
    Using…
    SQL Server Integration Services (SSIS)
    Business Intelligence Portfolio
  • Database from Excel and XML
  • Sample Excel Data
  • Sample SSIS Control Flow to LoadExcel Data
  • Sample SSIS Dataflow diagram to Process Rows
  • Sample Output SQL Table
  • Sample SSIS Package to ProcessMultiple Files
  • Sample Dataflow of Processing Multiple Files
  • Sample XML file Processing
  • Sample XML Control Flow
  • Sample XML Dataflow
  • Sample XML Data to SQL
  • Sample Master Package to ProcessAll Individual Packages
  • Sample
    T-SQL
    Scripts
    Business Intelligence Portfolio
  • IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GetWeekEndDate]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
    DROP FUNCTION [dbo].[GetWeekEndDate]
    GO
    CREATE FUNCTION dbo.GetWeekEndDate
    (@dDateDateTime)
    RETURNS DateTime AS
    BEGIN
    DECLARE @dRetDateDateTime
    SET @dRetDate =
    @dDate + ( 7 - DATEPART(WeekDay, @dDate))
    RETURN @dRetDate
    END
    go
    -- Create Function to return CoorespondingWeekEnd Key for a date
    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GetWeekEndDateKey]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
    DROP FUNCTION [dbo].[GetWeekEndDateKey]
    GO
    CREATE FUNCTION dbo.GetWeekEndDateKey
    (@dDateDateTime)
    RETURNS int AS
    BEGIN
    DECLARE @dRetDateDateTime
    SET @dRetDate =
    @dDate + ( 7 - DATEPART(WeekDay, @dDate))
    DECLARE @RetWEDateKeyint
    SET @RetWEDateKey = YEAR(@dRetDate) * 10000 + (DATEPART(m,@dRetDate) * 100) + DATEPART(d,@dRetDate)
    RETURN @RetWEDateKey
    END
    go
  • CREATE TABLE [dbo].[DimDates](
    [WeekendKey] [int] NOT NULL,
    [WeekendName] [nvarchar](30) NOT NULL,
    [QuarterKey] [int] NOT NULL,
    [QuarterName] [nchar](10) NOT NULL,
    [Year] [int] NOT NULL,
    CONSTRAINT [PK_DimDates] PRIMARY KEY CLUSTERED
    ( [WeekendKey] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    -- Load Dates Table
    Declare @StartDate date, @StopDate date, @CurDate date
    Set @Startdate = (Select MIN(dbo.GetWeekEndDate(WorkDate)) from dbo.JobTimeSheets)
    Set @StopDate = (Select MAX(dbo.GetWeekEndDate(WorkDate)) from dbo.JobTimeSheets)
    Set @CurDate = @StartDate
    While @CurDate <= @StopDate
    BEGIN
    INSERT INTO [dbo].[DimDates]
    ([WeekendKey]
    ,[WeekendName]
    ,[QuarterKey]
    ,[QuarterName]
    ,[Year])
    VALUES
    ( YEAR(@CurDate) * 10000 + (DATEPART(m,@curdate) * 100) + DATEPART(d,@curdate),
    DATENAME(month,@curdate) + ' ' + CAST(DATEPART(d,@curdate) as varchar(15))+ ', ' + CAST(YEAR(@CurDate) as VARCHAR(4)) ,
    DATEPART(Q,@curdate),
    'Q' + CAST(DATEPART(Q,@curdate) as varchar(1)) + ' ' + CAST(YEAR(@CurDate) as VARCHAR(4)) ,
    DATEPART(YYYY,@curdate))
    Set @CurDate = DATEADD(d, 7, @CurDate)
    END
  • ;WITH LaborCostCTE (EmployeePK, JobMasterPK, LaborCost) as (
    SELECT EmployeePK, JobMasterPK,
    HoursWorked* ( select HourlyRateFROM dbo.EmployeeRatesas ER1 WHERE
    ER1.EmployeePK = JTS.EmployeePK and ER1.EffectiveDate = (Select MAX(ER2.EffectiveDate)
    FROM dbo.EmployeeRates as ER2
    WHERE (ER1.EmployeePK = ER2.EmployeePK and ER2.EffectiveDate <= JTS.WorkDate))) As LaborCost
    FROM dbo.JobTimeSheets as JTS )
     
     
    INSERT INTO [dbo].[FactSummary]
    ([ProjectKey]
    ,[LaborProfit]
    ,[MarkupProfit]
    ,[AdditionalLaborProfit]
    ,[InvoiceAmount]
    ,[ReceivedAmount])
    SELECT JM.JobMasterPKas ProjectKey
    ,(SELECT SUM(LCC.Laborcost) FROM LaborCostCTEas LCC
    WHERE LCC.JobMasterPK= JM.JobMasterPK) * (JM.AdditionalOverheadPct/100) -- Labor Profit
    ,(SELECT sum(JP.PurchaseAmount) FROM dbo.JobMaterialPurchases as JP
    WHERE JM.JobMasterPK = JP.JobMasterPK) * (JM.MaterialMarkupPct/100) -- MarkupProfit
    ,(SELECT sum(IJAL.AdditionalLabor) FROM dbo.InvoiceXJobMaster as IJAL
    WHERE JM.JobMasterPK = IJAL.JobMasterPK) -- AdditionalLaborProfit
    ,(SELECT sum(IJIA.InvoiceAmount) FROM dbo.InvoiceXJobMaster as IJIA
    WHERE JM.JobMasterPK = IJIA.JobMasterPK) -- Invoice Amount
    ,(SELECT sum(IR.AmountPaid) FROM dbo.InvoiceReceipts as IR
    WHERE JM.JobMasterPK = IR.JobMasterPK) -- Received Amount
    FROM dbo.JobMaster as JM
  • SQL Server Analysis Services (SSAS)
    Data Warehouse
    OLAP Cube
    MDX Queries
    Business Intelligence Portfolio
  • Sample SSIS Package to run T-SQL Scripts
  • Sample DataSource View ofData Warehouse
  • Sample Hierarchies in OLAP Cube
  • Sample Cube Structure
  • Sample Calculation
  • Sample Calculated Set
  • Sample KPI
    Case
    WhenKPIVALUE("KPIOpenReceivablesAsPctofInvoice") > KPIGOAL("KPIOpenReceivablesAsPctofInvoice") + .10 THEN -1
    WHENKPIVALUE("KPIOpenReceivablesAsPctofInvoice") > KPIGOAL("KPIOpenReceivablesAsPctofInvoice") THEN 0
    ELSE 1
    End
  • Sample Action
    "http://maps.google.com/maps/api/staticmap?center=" + [Project].[County Name].CurrentMember.Member_Caption + ",PA&zoom=14&size=512x512&maptype=roadmap
    &markers=color:blue%7Clabel:S%7C40.702147,-74.015794&markers=color:green%7Clabel:G%7C40.711614,-74.012318
    &markers=color:red%7Ccolor:red%7Clabel:C%7C40.718217,-73.998284&sensor=false"
  • Sample Action Result
  • Sample Fact Table Partition
  • SELECT FL.[ProjectKey],FL.[WeekendKey],
    FL.[EmployeeKey],FL.[Hours],FL.[LaborCost]
    FROM [dbo].[FactLabor] as FL
    Join DimProject as DP on FL.[ProjectKey] = DP.[ProjectKey]
    Join DimDates as DD on DP.JobClosedDateKey = DD.Weekendkey
    where CAST(DD.WeekEndName as DATETIME) >= dbo.GetWeekEndDate('2005-06-16')
    SELECT FL.[ProjectKey],FL.[WeekendKey],
    FL.[EmployeeKey],FL.[Hours],FL.[LaborCost]
    FROM [dbo].[FactLabor] as FL
    Join DimProject as DP on FL.[ProjectKey] = DP.[ProjectKey]
    Join DimDates as DD on DP.JobClosedDateKey = DD.Weekendkey
    where CAST(DD.WeekEndName as DATETIME) < dbo.GetWeekEndDate('2005-06-16')
    Sample Fact Table Partition
  • Sample Perspective
  • Sample MDX Queries
    /* ------------------------------------------------------------------------------------
    For Carl Imhoff, show a list of projects and LaborCost,
    LaborCost for all employees, and LaborCost as a percent of LaborCost for all employees,
    sorted by the percent, where Carl has LaborCost for that project.
    ----------------------------------------------------------------------------------------*/
    with member [LaborCostForAllEmployees] as
    ( [Measures].[Labor Cost], [Employee].[Employee].[All] )
    member [LaborCostPct] as
    [Measures].[Labor Cost] / [LaborCostForAllEmployees],
    Format_String = 'Percent'
    SELECT non empty { [Measures].[Labor Cost], [LaborCostForAllEmployees], [LaborCostPct]}
    on columns,
    non empty order(
    filter( [Project].[Project Name].children, [Labor Cost] <> NULL) ,
    [LaborCostPct], desc) on rows
    FROM [AllWorks]
    WHERE [Employee].[Employee].&[CARL IMHOFF]
  • Sample MDX Queries
    /* ------------------------------------------------------------------------------------
    List the jobs that make up the top 30% of total invoice amount sorted by
    descending invoice amount
    ----------------------------------------------------------------------------------------*/
    WITH SET [Top30PercentClients] as
    TOPPERCENT( [Project].[Project Name].children,
    30, [Invoice Amount])
    SELECT non empty {[Invoice Amount]} on columns,
    non empty [Top30PercentClients] on rows
    FROM [AllWorks]
    /* ------------------------------------------------------------------------------------
    For Carl Imhoff, show a list of quarters on the columns,
    LaborCost and LaborCost as a percent of LaborCost for all employees for that quarter,
    but only LaborCost for the quarter for projects where Carl has LaborCost for that project for that quarter. (For example, in the 3rd quarter, if Carl had $100 in labor dollars, total labor cost was $500, but the total labor dollars for jobs that he worked on was $400 for that quarter, the % would be 25%)
    ----------------------------------------------------------------------------------------*/
    with member [LaborCostForAllEmployees] as
    sum( filter( [Project].[Project Name].children , [Labor Cost] <> null)
    ,( [Measures].[Labor Cost], [Employee].[Employee].[All] ) ), format_string = 'currency'
    member [LaborCostPctOfTotal] as
    [Measures].[Labor Cost] / [LaborCostForAllEmployees],
    Format_String = 'Percent'
    SELECT non empty Filter([Dates].[Quarter].Children, [Labor Cost] <> NULL) on columns,
    non empty {[Measures].[Labor Cost], [LaborCostPctOfTotal] } on rows
    FROM [AllWorks] WHERE [Employee].[Employee].&[CARL IMHOFF]
  • Sample SSRS and Performance Point Server
  • Sample SSRS and Performance Point Server
  • Sample SSRS and Performance Point Server
  • Sample SSRS and Performance Point Server
  • Performance Point Server DashboardKPI’s
  • Performance Point Server DashboardLinked Grid and Chart
  • Performance Point Server DashboardSSRS Map and Chart
  • Performance Point Server DashboardSSRS Report
  • Performance Point Server DashboardExcel Using Slicers