j. adcock bi portfolio

27
Business Intelligence Portfolio Jerry Adcock [email protected] 360-604-0411 Experienced: - BI - SSIS - SAS - MDX - SSRS - Data Warehousing - Custom Applications

Upload: jerry-adcock

Post on 14-Jul-2015

530 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: J. Adcock   Bi Portfolio

Business Intelligence

Portfolio

Jerry Adcock

[email protected]

360-604-0411

Experienced:

- BI

- SSIS

- SAS

- MDX

- SSRS

- Data Warehousing

- Custom Applications

Page 2: J. Adcock   Bi Portfolio

Table of Contents

• Project # 1 – ETL

• MDX Code Sample

• Assembly Language Code Sample

• Pascal Code Sample

Page 3: J. Adcock   Bi Portfolio

ETL – several sources, including OLE DB, Excel and .CSV files

• Introduction: Read the source files, transform them, check for errs and drop

the data into various DBs. Some of the error checking involves looking for duplicates, looking for ghost employees and jobs. Some of the error responses are to simply drop the incoming record, other responses are to log the error with the appropriate info.

• Audience: Sales, Marketing and Senior Management

• Project Goals: Extract Transform and Load into Staging area, data from various

sources, including OLE DB, Excel and CSV files.

Page 4: J. Adcock   Bi Portfolio

Project Sample

• Master Process Task – Page 1

Page 5: J. Adcock   Bi Portfolio

Project Sample

• Master Process Task – Page 2

Page 6: J. Adcock   Bi Portfolio

Project Sample

• Master Process Task – Page 3

Page 7: J. Adcock   Bi Portfolio

Project Sample

• Employee Rates

Page 8: J. Adcock   Bi Portfolio

Project Sample

• County & Division Process Task

Page 9: J. Adcock   Bi Portfolio

Project Sample

• Client Master

Page 10: J. Adcock   Bi Portfolio

Project Sample

• Client Groupings

Page 11: J. Adcock   Bi Portfolio

Project Sample

• Client Grouping XRef

Page 12: J. Adcock   Bi Portfolio

Project Sample

• Job Master

Page 13: J. Adcock   Bi Portfolio

Project Sample

• Job Time Sheets

Page 14: J. Adcock   Bi Portfolio

Project Sample

• Master Process Task – Page 3

Page 15: J. Adcock   Bi Portfolio

Project Sample

• Master Process Task – Page 3

Page 16: J. Adcock   Bi Portfolio

Project Sample

• Master Process Task – Page 3

Page 17: J. Adcock   Bi Portfolio

Project Sample - SSAS

• Sample MDX Generated Table

Page 18: J. Adcock   Bi Portfolio

Project Sample - SSAS

• Sample KPI Formula & Spreadsheet

Page 19: J. Adcock   Bi Portfolio

Project Sample - SSAS

• Sample KPI Formula & Spreadsheet

Page 20: J. Adcock   Bi Portfolio

Project Sample - SSAS

• Sample Tables Diagram

Page 21: J. Adcock   Bi Portfolio

Code Samples

• MDX Code Samples

/*

Exercise 2:

For all four quarters of 2005, show Customer Regions down the left....and here are the measures

Dollar Sales

Year to Date Dollar Sales (hint, use PERIODSTODATE)

The Year to Date Sales for the Prior Period (hint, use PARALLELPERIOD)

The dollar sales for the region, as a % of the dollar sales for the parent customer level (whatever the parent happens to be)

The same % as above, but for the Quarter last year (use parallelperiod as well)

*/

WITH

-- Define a set containing all 4 quarters of 2005

SET [2005 Qrts] AS {[Time].[YQM].[Quarter].[Q1, 2005]

: [Time].[YQM].[Quarter].[Q4, 2005]}

-- dollar sales and unit sales - may not need this

SET [DollarsUnits] AS {[Measures].[Dollar Sales], [Measures].[Unit Sales]}

-- YTD Sales based on the current member

-- (as it rolls through the cube)

MEMBER [Measures].[YTD Sales]

AS

SUM (PeriodsToDate ([Time].[YQMD].[Year], [Time].[YQMD].CurrentMember),

[Measures].[Dollar Sales])

Page 22: J. Adcock   Bi Portfolio

Code Samples

• MDX Code Sample - Continued

-- YTD Sales from Last Year based on CurrentMember

-- (as it roles through the cube)

MEMBER [Measures].[YTD LY Sales]

AS

SUM (ParallelPeriod ([Time].[YQMD].[Year], 1, [Time].[YQMD].CurrentMember),

[Measures].[YTD Sales]),

FORMAT_STRING = 'Currency'

-- Grand total from all regions

MEMBER [Measures].[GTRegions]

AS

SUM([Customer].[Customer].Parent, [Measures].[Dollar Sales])

-- percentage of change from this year

MEMBER [Measures].[PctOfParent]

AS

[Measures].[Dollar Sales] / [Measures].[GTRegions],

FORMAT_STRING = 'Percent'

-- GT of Regions Last Year

MEMBER [Measures].[GT LY Regions]

AS

SUM([Customer].[Customer].[Region].&[R1]:[Customer].[Customer].[Region].&[R9],

[Measures].[Dollar Sales])

Page 23: J. Adcock   Bi Portfolio

Project Sample

• MDX Code Sample - Continued

-- percentage of change from LAST YEAR

MEMBER [Measures].[PctOfParentLY]

AS

([Measures].[PctOfParent], ParallelPeriod ([Time].[YQMD].[Year], 1)), FORMAT_STRING = 'Percent'

---------------------------

-- start slicing and dicing

SELECT ([2005 Qrts], {[Measures].[Dollar Sales],

[Measures].[YTD Sales], [Measures].[YTD LY Sales],

[Measures].[PctOFParent],

[Measures].[PctOfParentLY]})

on columns,

[Customer].[Customer].[Region]

on rows

FROM SALES

Page 24: J. Adcock   Bi Portfolio

Code Samples

• Code Sample – Assembly Language;----------------

;-- --

;-- $Source: c:/visasm/RCS/mrj24.asm $

;-- $Date: 90/06/15 15:04:21 $

;-- $State: Exp $

;-- $Name$

;----------------

;-- $Author: Jerry_Adcock $

;----------------

;-- $Revision: 1.1 $

;-- $Branch$

;-- --

;----------------

; 2/20/89

; MRJX24 - GENERIC MESSAGES FOR 24 CATEGORY REJECTS

; MRJ141 : MOTOROLA LAWNDALE

;*************************************************************************

PUBLIC MRJ1, SRJ1

PUBLIC INIRJT

public PRJTBL, ENARJT

CSEG

MRJ1: DB 3, 12, ' 1) SCRATCH - ', 0

MRJ2: DB 3, 13, ' 2) MTL BRG - ', 0

MRJ3: DB 3, 14, ' 3) MTL DST - ', 0

MRJ4: DB 3, 15, ' 4) CHP OUT - ', 0

MRJ5: DB 3, 16, ' 5) CONTAMN - ', 0

MRJ6: DB 3, 17, ' 6) MTL ADH - ', 0

MRJ7: DB 3, 18, ' 7) MSS GLS - ', 0

MRJ8: DB 3, 19, ' 8) BND PAD - ', 0

MRJ9: DB 3, 20, ' 9) MTL COR - ', 0

MRJ10: DB 3, 21, '10) MSS PRB - ', 0

MRJ11: DB 3, 22, '11) PSS FLT - ', 0

MRJ12: DB 3, 23, '12) RES INK - ', 0

MRJ13: DB 41, 12, '13) MT VOID - ', 0

MRJ14: DB 41, 13, '14) DIFFUSN - ', 0

MRJ15: DB 41, 14, '15) WFR EDG - ', 0

MRJ16: DB 41, 15, '16) OTH GLS - ', 0

MRJ17: DB 41, 16, '17) MISC - ', 0

MRJ18: DB 41, 17, '18) M SCRIB - ', 0

MRJ19: DB 41, 18, '19) CRACK - ', 0

MRJ20: DB 41, 19, '20) XS GLAS - ', 0

MRJ21: DB 41, 20, '21) DIELECT - ', 0

MRJ22: DB 41, 21, '22) CONTACT - ', 0

MRJ23: DB 41, 22, '23) OTH MTL - ', 0

MRJ24: DB 41, 23, '24) PRB DMG - ', 0FFH

MRJEND EQU $

; BYTE COUNT OF REJECT MESSAGE DATA

;************************************************************************

;************************************************************************

; INIT THE REJECT TITLE DATA STORAGE WITH THE DEFAULT VALUES

Page 25: J. Adcock   Bi Portfolio

Code Samples

• Code Sample – Assembly Language – Cont’d

;----------------

;-INIRJT:

LXI H,MRJ1 ; GET THE REJECT MESSAGES FROM ROM

LXI D,SRJ1 ; GET THE RAM DESTINATION ADDRESS

LXI B,MRJEND - MRJ1 ; GET THE LENGTH OF THE BLOCK

IRJT1:

MOV A,M

STAX D

INX H

INX D

DCX B

MOV A,C

ORA B

JNZ IRJT1

;

call ENARJT ; enable the valid reject categories

RET

;******

;************************************************************************

; SET THE REJECT ENABLE FLAG TABLE ( for 24 rejects )

ENARJT:

lxi h,SRJ1+2 ;point to the new messages

mvi b,0 ; loop through 24 reject messages

Page 26: J. Adcock   Bi Portfolio

Code Samples

• Code Sample – Assembly Language – Cont’dERJT1:

lxi d,DISMSG ; point to the disable reject compare string

mvi c,DMSGL ; load the length of the string

ERJT2:

ldax d ; get a string character

cmp m ; compare with the new string

jnz ERJT ; enable the reject if no compare

;

inx h ; point to the next characters

inx d

dcr c ; lower the character counter

jnz ERJT2 ; jump if more characters left to check

;

xra a ; message compares - disable this category

ERJT3:

mov e,c ; move the pointer to the next message

mvi d,0

dad d ; add the distance to the end of the string

lxi d,3 ; now skip the string terminator & cursor pos

dad d

push h ; save the pointer to the new messages

lxi h,PRJTBL ; get the pointer to the reject enable table

mov e,b ; point to the correct reject

mvi d,0

dad d

mov m,a ; store the enable/disable flag

pop h ; restore the pointer to the new messages

inr b ; test the next reject message

mvi a,24 ; unless they have all been tested

cmp b

jnz ERJT1 ; jump if more left to test

;

ret

;******

Page 27: J. Adcock   Bi Portfolio

Code Samples

• Code Sample – Assembly Language – Cont’dERJT:

mvi a,0ffh ; enable the category

jmp ERJT3 ; store enable flag

;

DISMSG: DB ' '

DMSGL equ $ - DISMSG ; length of the compare string

;************************************************************************

;************************************************************************

DSEG

SRJ1: DS MRJEND - MRJ1

PRJTBL: DS 24 ; PROGRAMMED REJECT ENABLE TABLE

;************************************************************************

END