Você está na página 1de 61

Qlik2Go - Core Demo Project

Data Model Technical Reference

Published: January, 2015


Version: 1.0
Last Updated: December, 2014

1 | Page

Table of Contents
1
Overview
.
2 Basic Data Model Design
Concepts..
3 Basic Data Model
Design
.
3.1 Basic Data
Model
.
3.2 Base Tables in the Data
Model..
3.2.1 Call Center
Agent
..
3.2.2 Call Center Service Call Type..

3.2.3 Call Center


Fact

3.2.4 Call Center


Group

3.2.5 Call Center Handle


Type.
3.2.6 Call Center Severity
Type..
3.2.7 Company(Retired)
..
3.2.8
Competitor
..
3.2.9
Customer
..
3.2.10
Employee
..
3.2.11 Finance Travel and
Expense.
3.2.12 Financial
Planners
..

4
4
4
4
5
5
6
6
7
7
8
8
9
9
10
11
12
12
13
13
14
14
14
15
15
16
17
17
18
18
19
20
22
23
24
26
26

28
28
30
32
2 | Page

3.2.13 Marketing
Calendar.
.
3.2.14 Marketing
Campaigns.
3.2.15 Marketing
Channels.
3.2.16 Marketing Referral
Sources
3.2.17 Order
Method
..
3.2.18
Product
.
3.2.19 Sales
Calendar
.
3.2.20 Sales Finance
Fact.
3.2.21 Sales Marketing
Fact..
3.2.22 Sales Pipeline
Calendar..
3.2.23 Sales Quotas
Fact..
3.3 Marketing Campaign Performance - Modification of
base data model
4 Raw
Data
..
4.1 Customer Folder Raw
Data.
4.2 Customer Service Folder Raw
Data
4.3 Finance Folder Raw
Data..
4.4 HR Folder Raw
Data
..
4.5 Marketing Folder Raw
Data.
4.6 Products Folder Raw
Data.
4.7 Sales Folder Raw

33
34
37
38
39
40
41

3 | Page

Data..

5 QVD Processing &


Data

5.1 Customers
Tab
..
5.2 Sales
Tab

5.3 Finance
Tab
.
5.4 Pipeline
Tab
.
5.5 Marketing
Tab
...
5.6 Employees
Tab

5.7 Products
Tab

5.8 Customer Service


Tab
5.9 QVD Builders
Tab
..
6 Final QVD List..
...

4 | Page

1. Overview
This document is the reference guide for the data model used for the Core Demo
Platform.
The tables, fields, joins, QVD, and data creation process will be
documented in the following sections. This common data model is used to feed all
the applications that are part of the Core Demo Platform demo system.

2. Basic Data Model Design Concepts


This data for this project was assembled from 8+ different sources of origin. To that
end, a tremendous amount of work has taken place to assemble and standardize
the data and raw tables into a set of information that connects together in a way
that makes the data flow through the various sources into all the applications
seamlessly. When QlikSense eventually gets document chaining the applications
will allow jumping between applications with ALL selections being passed with no
loss of contextual relevancy.

3. Basic Data Model Design


3.1 Basic Data Model

So yes, its really hard to read (no worries, well break it up in detail) but it
illustrates the complexity of the various data elements connected together to build
the platform.
There are 30+ raw tables that were combined together into the 23 tables below in
5 | Page

order to create this final data model. The raw data tables will be covered later in
the document along with the QVD creation process to build the above data model.
NOTE: The applications Marketing Campaign Performance has a modified data
model to accommodate the requirements of externally generated leads and an
outsourced marketing operational group. This modification is covered in section
3.3.
3.2 Base Tables in the Data Model
Here is a breakdown of the tables included in the data model for the published
applications. Each table will be identified with its Key(s), Dimension field, Measure
field, and description of which application its used within. The name will include
the tables full name, [Dimension/Fact] indicator, and (Name) which is what the
table is called in the actual data model.
3.2.1) Call Center Agent, [Dimension] - (CallCenterAgents) This table is a
lookup table for the Call Center Fact table that describes details about the call
center agents and related information about them.

Keys

Dimension
s

zAgentID

Connects to CallCenterFact

Call Ctr Agent

Agent Name

Call Ctr County

Agent Country

Call Ctr Location

Agent City Location

3.2.2) Call Center Service Call Type, [Dimension] - (CallCenterCallType)


This table is a lookup table for the Call Center Fact table for descriptions of why
people call into customer service.
6 | Page

Keys

zSVCTYPEKEY

Connects to CallCenterFact

Dimension

Call Center Service


Type

Description of the Call Center Service Type

3.2.3) Call Center Fact, [Fact] - (CallCenterFact) This is the primary fact
table for all the Call Center Metrics in the Call Center Applications.

zGRPKEY

Connects to CallCenterGroup

zCALLSEVKEY

Connects to CallCenterSeverity

zAgentID

Connects to CallCenterAgents

zORGKEY

Connects to Company and SalesFinanceFact

zCallCtrHandleTypeID

Connects to CallCtrHandleType

zSVCTYPEKEY

Connects to CallCenterCallType

Call Ctr Call Date

Date call was logged into the Call Center


(MM/DD/YYYY)

Call Ctr Call Month

Month call was logged into the Call Center

Call Ctr Call Week

Week call was logged into the Call Center

Call Ctr Call Weekday

Weekday call was logged into the Call Center

Keys

Dimension
s

7 | Page

Measures

Call Ctr Closed Tickets

0/1 Flag if ticket is closed (1) or open (0)

Call Ctr Open Tickets

0/1 Flag if ticket is open (1) or closed (0)

Call Ctr Days to


Resolve

Number of days per call it took to resolve (for closed


tickets)

Call Ctr Days Aging

Age of non-resolved calls (only valid for open tickets)

Call Ctr Call Time

Timestamp call received by the call center


(MM/DD/YYYY:HH:MM)

Call Ctr Call Hour

Hour the call was received by the call center

Call Ctr Ticket #

Ticket number generated when call center called

Call Ctr Call #

Flag representing a call was made (1 only)

Call Ctr Completed #

Flag 1/0 if call was completed successfully

Call Ctr Terminated #

Flag 1/0 if call was terminated during call

Call Ctr Active Agent #

Count of how many Agents needed for a call

Call Ctr Call Duration

How long the call lasted (minutes)

Call Ctr Avg Hold Time

Average hold time before agent response (minutes)

Call Ctr Call Costs

Estimated personnel cost to answer support call

Call Ctr Hold Time w/


SLA

Length of hold time for SLA customers (minutes)

Call Ctr Hold Time w/o


SLA

Length of hold time for non SLA customers (mins)

Call Ctr Call Duration


within SLA

How long the call lasted (minutes) for customers with


SLA

Call Ctr Call Duration


no SLA

How long the call lasted (minutes) for customers


without SLA

Call Center Satisfaction


Level

Customers rating of their satisfaction level with the


agent (range 0.00-1.00)

Call Center Quality


Level

Customers rating of their satisfaction level on the


quality of the solution provided (range 0.00-1.00)

8 | Page

Call Center Tech Level

Customers rating of their technical level of the support


person (range 0.00-1.00)

3.2.4) Call Center Group, [Dimension] - (CallCenterGroup) This table is a


lookup table for the Call Center Fact table for descriptions of call center groups.

Keys

zGRPKEY

Connects to CallCenterFact

Dimension
s

Call Center Group

This is a list of the call center groups.

3.2.5) Call Center Handle Type, [Dimension] - (CallCenterHandleType)


This table is a lookup table for the Call Center Fact table for descriptions of call
center groups.

Keys

zCallCtrHandleTypeID

Connects to CallCenterFact

Dimension
s

Call Ctr Handle Group

This is a list of how incoming calls enter the call center

3.2.6) Call Center Severity Type, [Dimension] - (CallCenterSeverityType)


This table is a lookup table for the Call Center Fact table for descriptions of call
center groups.

9 | Page

Keys

zCALLSEVKEY

Connects to CallCenterFact

Dimension
s

Call Center Severity


Type

This is a list of incoming calls severity level

3.2.7) Company (Retired), [Dimension] - (Company) This table details the


B2B (direct business) customers we service with description of the related attributes
for each B2B customer.

Keys

zORGKEY

Connects to CallCenterFact and SalesFinanceFact

Dimension
s

Company Market Cap

Dollar figure of the market value of the customers


company.

Company Industry

Description of the customers industry vertical

Lead Source

Where inbound contact lead came from that led to that


company becoming a customer/partner

Company Annual
Spend

How much on average a company spends annually on


our products

Company Email Opt


Out Flag

Flag (1/0) if the customer has opted out of email


campaigns

Company Employee
Count

Number of employees the company has currently


employed

Company Tier

Partner level (Bronze, Silver, Gold, Platinum, Platinum


Elite)

Company Primary
Channel

Primary way the company buys/sells our products

Company Email on File

Flag (Yes/No) if the company has email contact on file

Company Annual
Revenue

Amount of revenue earned by partner company

Company Channel

Partner channel preference methodology for

10 | P a g e

Preference

communication

Company Twitter
Handle

Flag (Y/N) does the partner have a twitter handle

Company Tenure

How long has the company been a partner

Company Since Date

Date company signed up as a partner (MM/DD/YYYY)

Company Region

Region of world the partner company is located

Company Country

Country of world the partner company is located

Company GeoKey

GeoKey (lat/long) of the street address for the partner


company

Company Zip

Zip code of where the partner company is located

Company City

City where the partner company is located

Company Name

Name of the partner company

Company Street
Address

Street address for the partner company

Marketing Avg Click


Stream Page Duration

Average time spent by partner company on any


website page

Company Web Login


Duration

Total measure of how long a partner has been logged


onto our website

Measures

3.2.8) Competitor, [Dimension] - (Competitor) This table details the list of


competitors faced in sales cycles.

Keys

zMarketingCompetitorI
D

Connects to SalesMarketingFact

Dimension
s

Competitor

Names of our competitors we face

11 | P a g e

3.2.9) Customer, [Dimension] - (Customer) This table details the B2C (direct
to consumer) customers we service with description of the related attributes for
each B2C customer.

Keys

zCONTACTKEY

Connects to SalesMarketingFact and


SalesFinanceFact

Dimension
s

Customer Age Group

Customers Age

Customer DOB

Customers date of birth (MM/DD/YYYY)

Customer Name

Name of customer (Last, First)

Customer Lead Source

Method customer was contacted by to buy product

CustomerHousehold
Size

Number of persons in the customers household

Customer Email

Unused Not correctly populated, currently

Customer Homeowner

Flag (Y/N) if the customer owns a home

Customer Marital
Status

Flag (Y/N) if the customer is married

Customer Contact
Preference

Preferred method of contact

Customer Annual
Income

Customers annual income

Customer Status

Status of customers account

Customer Tier

Status tier of the customer

Customer Age

Age of the customer

Customer Education
Level

Education level of the customer

Customer Gender

Customer gender (M/F)

12 | P a g e

Dimension
s

Customer Email Opt


Out

Flag (Yes/No) has the customer opted out of email


campaigns

Customer Ethnicity

Ethnicity of customer

Customer Tenure

How long has the individual been a customer

Customer Zip/Postal

Zip code where customer is located

Customer City

City where the customer is located

Company Street
Address

Street address for the customer

Customer
State/Province

State/Province for the customer

Customer Country

Country where the customer is located

CustomerGeoKey

Geokey (lat/long) of customers location

Customer Update
Status Date

Last updated date of customer status

Company Market Cap

Dollar figure of the market value of the customers


company.

Company Industry

Description of the customers industry vertical

Company Lead Source

Where inbound contact lead came from that led to that


company becoming a customer/partner

Company Annual
Spend

How much on average a company spends annually on


our products

Company Employee
Count

Number of employees the company has currently


employed

Company Primary
Channel

Primary way the company buys/sells our products

Company Annual
Revenue

Amount of revenue earned by partner company

Company Twitter
Handle

Flag (Y/N) does the partner have a twitter handle

13 | P a g e

Measures

Company Name

Name of the partner company

Company Street
Address

Street address for the partner company

Marketing Avg Click


Stream Page Duration

Average time spent by partner company on any


website page

Company Web Login


Duration

Total measure of how long a partner has been logged


onto our website

3.2.10) Employee, [Dimension] - (Employee) This table is the master


Employee reference, it contains detailed employee attributes.

Keys

zEMPKEY

Connects to SalesFinanceFact and FinanceTEFact

Dimension
s

Employee City

Employees city location (Org Geo L4)

Employee Name

Employees full name (First Last)

Employee Gender

Employeer gender (M/F)

Employee Area

Organizational Area for the employee (Org Level 1)

Employee Dept

Organizational Dept for the employee (Org Level 2)

Employee Business
Unit

Organizational Business Unit for the employee (Org


Level 3)

Employee Job Title

Job Title for the employee (Org Level 4)

Employee Region

Organizational Region where employee is located (Org


Geo L1)

Employee Country

Organizational Country where employee is located (Org


Geo L2)

Employee State

Organizational State where employee is located (Org


Geo L3)

14 | P a g e

Employee DOB

Employee DOB in Julian format (not used)

Employee Birth Date

Employee Date of Birth (MM/DD/YYYY)

Employee Birth Month

Birth Month and Year of employee (MMM YYYY)

Employee Birth Year

Birth Year of employee

Employee Job Class

Classification of employees role in the company

Employee Manager

Flag (Y/N) if the employee is a manager

Employee Employment
Type

Employees full or part time employment type


(FTE/PTE)

Employee Band

Employees Band level status (1-10), 10 is executive


level

Employee Perf Rating

Employees performance evaluation rating (A-D)

Employee Ethnicity

Employees ethnicity

Employee Hire Date

Date employee was hired (MM/DD/YYYY)

Employee Hire Month

Hire Month and Year of employee (MMM YYYY)

Employee Hire Year

Hire Year of employee

Employee Termination
Date

Date employee was terminated (MM/DD/YYYY)

Employee Termination
Month

Termination Month and Year of employee (MMM YYYY)

Employee Termination
Year

Termination Year of employee

Employee Age

Age of employee

Employee Tenure

How long employee has been employed

Employee Active Flag

Flag (1/0) if employee is currently employed

Employee Inactive Flag

Flag (1/0) if employee is currently not employed

Employee Recruitment
Source

Description of how employee came into employment

15 | P a g e

Dimension
s

Employee Referral
Source

If an employee was referred method of referral

Employee Termination
Type

Flag for termination reason (Voluntary/Involuntary)

Employee Termination
Reason

Reason for dismissal / resignation from the company

Employee Salary

Current employee salary

Employee Total
Compensation

Additional compensations for employee (Bonus)

EmployeeGeoPoint

Geo location (lat/long) of employee

3.2.11) Finance Travel and Expense, [Fact] - (FinanceTE) This table


contains travel and expense metrics for employees.

Keys

Dimension
s

Measures

zEMPKEY

Connects to Employees and FinanceTEFact

Finance T&E Billable

Flag (Yes/No) Is an Employees expense billable?

Finance T&E Type

Type of expense filed by employee

Finance T&E Category

Higher level category group of expense types

Finance T&E Date

Date of expensed transaction (MM/DD/YYYY)

Finance T&E Period

Period (MMM YYYY) of expensed transaction

Finance T&E Month

Month of expensed transaction

Finance T&E Quarter

Quarter of expensed transaction

Finance T&E Year

Year of expensed transaction

Finance T&E Amount

Actual amount requested for reimbursement

Finance T&E Budget

Budgeted amount planned for reimbursement

16 | P a g e

3.2.12) Financial Planners, [Dimension] - (FinancialPlanners) This table


contains details around the Planning Departments individual planners and
management chain.

Keys

Dimension

zDemandEmpID

Connects to SalesFinanceFact

Finance Demand
Director

Director of Financial Demand Planning

Finance Demand
Manager

Managers of Financial Demand Planners

Finance Demand
Planner

Individual Financial Demand Planners

3.2.13) Marketing Calendar, [Dimension] - (MarketingCalendar) This table


is a master date dimension for Marketing time analytics.

Keys

MarketingDate

Connects to SalesMarketingFact

Dimension
s

MarketingYear

Year that the marketing campaign was executed

MarketingMonth

Month that the marketing campaign was executed

MarketingMonthYear

Month and Year that the marketing campaign was


executed (MMM-YYYY)

MarketingQuarter

Quarter that the marketing campaign was executed

MarketingCY

Flag (1/0) if the marketing event is within the current

17 | P a g e

year
MarketingLY

Flag (1/0) if the marketing event is within the previous


year

MarketingCQ

Flag (1/0) if the marketing event is within the current


quarter

MarketingLQ

Flag (1/0) if the marketing event is within the previous


quarter

MarketingCM

Flag (1/0) if the marketing event is within the current


month

MarketingLM

Flag (1/0) if the marketing event is within the previous


month

3.2.14) Marketing Campaign, [Dimension] - (MarketingCampaigns) This


table contains the details for the marketing campaigns that have been and
associated opportunities.

Keys

zMarketingCampaignID

Connects to SalesMarketingFact

Dimension
s

Marketing Campaign
Date

Date that the marketing campaign was launched

Marketing Campaign
Objective

Description of the intended reason behind the


marketing campaign

Marketing Owner

Owner of the marketing campaign (may not be internal


employee)

Marketing Sector

Description of specific or generic vertical targeted by


the campaign

Marketing Status

Status of the marketing campaign

Marketing Campaign
Sub Type

Subcategory detail (if relevant) for the marketing


campaign

18 | P a g e

Marketing Campaign
Theme

If a campaign has a theme, this will be populated

Marketing Campaign
Topic

Description of the specific campaign topic (if relevant)

Marketing Campaign
Type

Classification of the type of campaign being run

Marketing Campaign
Target Job Function

If a targeted campaign, the type of job function that a


specific campaign was delivered to

Marketing Campaign
Target LOB

If a targeted campaign, the line of business that a


specific campaign was designed to market to

Marketing Method

Type of method used to execute the campaign


(Direct/Indirect)

Marketing Campaign

Individual marketing campaign code

Opportunity Name

Sales opportunity associated with marketing campaign

Marketing Campaign
Influence

Flag (1/0) if the marketing campaign influenced a


buying decision

Marketing Owner
Function

Position/Role of the campaign owner

3.2.15) Marketing Channels, [Dimension] - (MarketingChannels) This table


is contains the details for the marketing campaigns that have been and associated
opportunities.

Keys

zMarketingChannelID

Connects to SalesMarketingFact

Dimension
s

Marketing Channel

Direct/Retail/Internet channel used for campaign and


marketing

19 | P a g e

3.2.16) Marketing Referral Sources [Dimension] (MarketingReferralSources) This table contains the inbound marketing lead
description system.

Keys

zMarketingReferrralSou
rceID

Connects to SalesMarketingFact

Dimension
s

Marketing Referral
Source

Inbound lead referral source (Google, Direct, Twitter,


etc)

3.2.17) Order Method [Dimension] - (OrderMethod) This table describes the


methods used to order product.

Keys

zOMKEY

Connects to SalesFinanceFact

Dimension
s

Sales Order Method

Description of sales order method (Retail/Direct/Online)

3.2.18) Product, [Dimension] - (Product) This table contains product details


of the items that we sell through our various methods.

Keys

zPKEY

Connects to SalesFinanceFact

Dimension
s

Product Category

Product category - Level 1 of product hierarchy

Product Sub Category

Product sub-category - Level 2 of product hierarchy

20 | P a g e

Product Group

Product group - Level 3 of product hierarchy

Product Vendor

VendorID of product manufacturer

Product Name

Product Name - Level 4 of product hierarchy

Product Model

Product Model Code

Product Unit Cost

Product Manufacturing Cost

Product Price

Product Suggested Retail Price

Product Weight

Weight of Product

Product Weight Bucket

Weight grouping buckets of individual products

3.2.19) Sales Calendar, [Dimension] - (SalesCalendar) This table is a master


date dimension for sales time analytics.

Keys

Sales Order Date

Connects to SalesFinanceFact

Dimension
s

Sales Year

Year that the sales transaction occurred

Sales Month

Month that the sales transaction occurred

Sales MonthYear

Month and Year that the sales transaction occurred


(MMM-YYYY)

Sales Quarter

Quarter that the sales transaction occurred

Sales CY

Flag (1/0) if the Sales transaction is within the current


year

Sales LY

Flag (1/0) if the Sales transaction is within the previous


year

Sales CQ

Flag (1/0) if the Sales transaction is within the current

21 | P a g e

quarter
Sales LQ

Flag (1/0) if the Sales transaction is within the previous


quarter

Sales CM

Flag (1/0) if the Sales transaction is within the current


month

Sales LM

Flag (1/0) if the Sales transaction is within the previous


month

3.2.20) Sales Finance Fact, [Fact] - (SalesFinanceFact) This is the primary


fact table for all sales transactions.

Keys

Dimension

zCONTACTKEY

Connects to SalesMarketingFact and Customer

Sales Order Date

Connects to SalesCalendar

zPKEY

Connects to Product

zORGKEY

Connects to Company and CallCenterFact

zOMKEY

Connects to OrderMethod

zDemandEmpID

Connects to FinancialPlanners

zSOKEY

Unused (future option)

zQKEY

Unused (future option)

zCUSTKEY

Unused (future option)

zPROMOKEY

Unused (future option)

zBRKEY

Unused (future option)

Sales Ship Date

Date product was shipped to customer

Sales Close Date

Date product sale was closed

22 | P a g e

Measures

Sales Order Detail Line

Line item transaction number per Order Number

Sales Order Number

Sales Order number

Sales Order Days Aging

Days between transaction and ship date

Sales Order Days Aging


Bucket

Grouping of days aging into buckets

Sales Order Status

Flag (Ontime/Late) on the status of an order

Sales Order Ontime

Flag (1/0) on whether an order is ontime or late

Sales Shipment Method

Method used to ship product (Air/Ground)

Sales Quantity

Quantity of product sold

Sales Price by Unit

Price and item is sold for as individual product

Sales Gross Margin

Margin (Sale Price Cost) per item sold

Sales Revenue

Total Revenue per order

Sales Gross Profit

Total Profit (Margin * Qty) per order

Sales Return Revenue

Revenue lost by of returned product (beta)

Sales Units Returned

Units of product returned (beta)

Sales Forecast

Forecasted value of sales revenue

Sales Costs

Cost of goods sold per order

3.2.21) Sales Marketing Fact, [Fact] - (SalesMarketingFact) This is the


primary fact table for all marketing, opportunity, and quota planning events.

Keys

zMarketingReferralSour
ceID

Connects to MarketingReferralSources

23 | P a g e

zMarketingChannellID

Connects to MarketingChannels

zMarketingCampaignID

Connects to MarketingCampaigns

Marketing Date

Connects to MarketingCalendar

zEMPKEY

Connects to Employees and FinanceTEFact

Sales Pipeline Date

Connects to SalesPipelineCalendar

zMarketingCompetitorI
D

Connects to Competitors

zCONTACTKEY

Connects to SalesFinanceFact and Customer

zQUOTAKEY

Connects to SalesQuotasFact

zMarketingPageID

Unused (future option)

Marketing Campaign
Conversion Date

Date of Marketing Campaign Conversion Date (do not


use)

Marketing Page Rank

Dimension
s

Measures

Sales Opportunity Age

How old (in days) has the opportunity existed

Sales Stage

Pipeline stage of an opportunity

Sales Won/Lost

Flag (1/0) Closed status of an opportunity 1=Win,


0=Lost

Sales Opp Status

Flag (Won/Lost) of an opportunity

Sales Closed

Flag (1/0) Is the opportunity closed (1) or open (0)

Sales Stage Duration

Duration (days) of the opportunity in the current sales


stage

Marketing Leads

# of leads

Marketing Conversions

# of leads converted to opportunities

Marketing Calls

# of calls generated from leads

Marketing Cost

Estimated cost of lead management

Marketing Visitors

# of visitors that have visited our website

24 | P a g e

Marketing Unique
Visitors

Distinct # of visitors that have visited our website

Sales Opportunity
Amount

Estimated value of opportunity based on initial lead


conversion

3.2.22) Sales Pipeline Calendar, [Dimension] - (SalesPipelineCalendar)


This table is a master date dimension for Pipeline time analytics.

Keys

Dimension
s

Sales Pipeline Date

Connects to SalesMarketingFact

Sales Pipeline Year

Year for the sales pipeline

Sales Pipeline Month

Month for the sales pipeline

Sales Pipeline
MonthYear

Month and Year that for the sales pipeline (MMM-YYYY)

Sales Pipeline Quarter

Quarter for the sales pipeline

Sales Pipeline CY

Flag (1/0) if the Sales Pipeline is within the current year

Sales Pipeline LY

Flag (1/0) if the Sales Pipeline is within the previous


year

Sales Pipeline CQ

Flag (1/0) if the Sales Pipeline is within the current


quarter

Sales Pipeline LQ

Flag (1/0) if the Sales Pipeline is within the previous


quarter

Sales Pipeline CM

Flag (1/0) if the Sales Pipeline is within the current


month

Sales Pipeline LM

Flag (1/0) if the Sales Pipeline is within the previous


month

3.2.23) Sales Quota Fact [Fact] - (SalesQuotasFact) This table contains


quota information for the sales reps.

25 | P a g e

Keys

zQUOTAKEY

Connects to SalesFinanceFact

Measures

Sales Quota

Sales quotas for the sales representatives

3.3) Marketing Campaign Performance - Modification of the base data


model. This adjustment disconnects the Employee and FinanceTEFact tables from
the data model as the marketing employees are not part of the internal employees
system and also have no relationship with T&E costs.

26 | P a g e

4. Raw Data
This section will detail the raw data imports used to build the CDP applications.
These files are contained in excel files, with multiple tabs in each organized by
source type.

4.1) Customer Folder Raw Data Contains Contact and Customer master excel
files. In this folder, there are two excel files: CDPCustomerMaster.xlsx and
CDPCustomerMaster.xlsx.
4.1.1) CDP Customer Master (2500 records) Customer Master is a list
of companies that buy/sell products through various channels.
Fields:
-marketCap
-avgClickStreamPageDuration
-industrySector
-leadSource
-annualSpend
-eMailOptOutFlag
-employeeCount
-tier
-primaryChannel
emailOnFile
-annualRevenue
-contactChannelPreference
-hasTwitterHandle
-companyId
-webLoginDuration
-customerSinceDate
-Region
-Country
-Zip
27 | P a g e

-City
-CompanyName
-StreetAddress
-Latitude
-Longitude
4.1.2) CDP Contact Master (18372 records) Contact Master is a list of
individual customers that have purchased product directly.
Fields:
-dateOfBirth
-leadSource
-avgWebsiteVisit
-houseHoldSize
-maritalStatus
-ownHomeFlag
-annualIncome
-customerId
-accountStatus
-educationLevel
-age
-customerTier
-gender
-emailOptOut
-firstName
-lastName
-emailDomain
-contactPreference
-customerSinceDate
-ethnicity
-AddressLine1
-City
-PostalCode
-State / Province
-Country
-CountryISOCode
-Latitude
-Longitude
-Status Date
4.2) Customer Service Folder Raw Data - Contains Call Center Fact excel file.
In this spreadsheet are tabs for Call Center Fact, Handle Type, Agent, Group, Service
Type, and Call Severity. There are other tabs but they are unused.
4.1.1) Call Center Fact (10995 records) contains the keys, dimensions, and
measure for all the call center metrics

28 | P a g e

Fields:
-Date_ID
-Time_ID
-Close Date
-Days to Resolve
-Days Aging
-Agent_ID
-HandleTypeID
-Product_ID
-Group_ID
-Service_Type_ID
-Call_Severity_ID
-Customer_ID
-Case #
-# Call
-# Terminated
-# Completed
-# Active Agent
-Call Duration
-Avg Hold Time
-Call Costs
-Hold Time with SLA
-Hold Time Mising SLA
-Call Duration within SLA
-Call Duration missing SLA
-Satisfaction Level
-Quality Level
-Tech Level
4.1.2) HandleType (3 records) contains lookups for call center fact
Fields:
-HandleTypeID
-Handle Type
4.1.3) Agent (99 records) contains lookups for call center fact around agents
Fields:
-Agent ID
-Territory
-Country
-Call Center
-Manager
-Team Lead
-Agent

City

4.1.4) Group (5 records) contains lookups for call center fact around groups
29 | P a g e

Fields:
-GroupID
-Group
4.1.5) Service_Type (15 records) contains lookups for call center fact around
service types
Fields:
-Service_TypeID
-Service_Type
4.1.6) Call_Severity (3 records) contains lookups for call center fact around
severity
Fields:
-Call_SeverityID
-Call_Severity
4.3) Finance Folder Raw Data - Contains Expenses excel file. This spreadsheet
has T&E information for Employees
4.3.1) Finance Expenses (86803 records) contains the keys, dimensions, and
measure for all the finance T&E fact.
Fields:
-Billable
-EmployeeID
-Expense Type
-Expense Category
-Expense Report
-Expense Report Exception
-Exception Reason
-Year
-Quarter
-Period
-Month
-Date
-Amount
-Budget
-Budget1
4.4) HR Folder Raw Data - Contains the HR excel file. This spreadsheet tabs for
Employee information and Demand Planners.
4.4.1) Employee (1815 records) contains employee details
Fields:
-Employee State
30 | P a g e

-Employee City
-Date of Birth
-Job Classification
-Manager
-Employment Type
-Band
-Performance Rating
-Ethnicity
-Hire Date
-Active
-Recruitment Source
-Referral Source
-Termination Date
-Termination Type
-Termination Reason
-Salary
-Compensation
-EmployeeLatitude
-EmployeeLongitude
4.4.2) Demand Planners (75 records) contains demand planner employee
management details
Fields:
-DemandEmplD
-Demand Director
-Demand Manager
-Demand Planner

4.5) Marketing Folder Raw Data - Contains the marketing excel file. This
spreadsheet tabs for MarketingFact, Campaigns, Channel, Leads, Pipeline, and
Competitor.
4.5.1) MarketingFact (160350 records) contains the main fact for marketing
information.
Fields:
-SALES_ORDER_KEY
-CampaignID
-ChannelID
-CUSTOMERID
-ReferralSourceID
-Sales Create Date
-Sales Close Date
-Conversion Date
-PageID
31 | P a g e

-Visits
-Conversions
-Calls
-Campaign Cost
-PageID
-Visitors
-Unique Visitors
-PageRank
-Opportunity Age
-Sales Stage
-IsWon
-IsClosed
-CompetitorID
-Stage Duration
-Opportunity Amt
-zEMPKEY
4.5.2) Campaigns (2269 records) contains the campaign details information
Fields:
-CampaignID
-Campaign Start Date
-Campaign Objective
-Campaign Owner
-Campaign Sector
-Campaign Status
-Campaign Sub Type
-Campaign Theme
-Campaign Topic
-Campaign Type
-Campaign Group
-Employee Range
-Campaign Job Function
-Campaign Line of Business
-Campaign Method
-Campaign Name
-Campaign Influence
-Campaign Owner Function
4.5.3) Channel (3 records) contains the channel details
Fields:
-ChannelID
-Channel
4.5.4) Leads (24 records) contains the lead source details
Fields:
32 | P a g e

-ReferralSourceID
-ReferralSource
4.5.5) Pipeline (50692 records) contains the details for the sales pipeline
Fields:
-StartDate (subtract from Close Date)
-CampaignID
-Sales Stage
-IsWon
-IsClosed
-CompetitorID
-Stage
-Duration
-Opportunity Amt
-zEMPKEY
4.5.6) Competitor (7 records) contains the details on competitors
-CompetitorID
-Competitor
4.6) Products Folder Raw Data - Contains the products excel file.
4.6.1) Product_DIM (1977 records) contains the product details
-PRODUCT_KEY
-PRODUCT_CATEGORY
-PRODUCT_SUBCAT
-PRODUCT_GROUP
-PRODUCT_VNDR
-PRODUCT
-PRODUCT_MDL
-UNITCOST
-UNITPRICE
-PRODUCTWEIGHT
4.7) Sales Folder Raw Data - Contains the sales fact excel file (also tab for order
methods) and sales quotas excel file.
4.7.1) SalesFinanceFace (201594 records) contains the sales fact details
-PRODUCT_KEY
-SALES_ORDER_KEY
-Year
-ORDER_DAY (test)
-ORDER_DAY
-QUOTA_KEY
-ORGANIZATION_KEY
-EMPLOYEE_KEY
-DemandPlannerID
33 | P a g e

-EMPLOYEE_KEY (Rand)
-CUSTOMER_KEY (orig)
-CUSTOMER_KEY
-PROMOTION_KEY
-ORDER_METHOD_KEY
-BRANCH_KEY
-SHIPPING_DAY
-CLOSE_DAY
-QTY_ORDERED
-SALE_PRICE_UNIT
-GROSS_MARGIN
-TOTAL_SALE_REVENUE
-COSTS (orig)
-COSTS
-GROSS_PROFIT
-ORDER_DETAIL_LINE
-ORDER_NUMBER
-QUOTAPRODUCT
-PRODUCT_MDL
-RETURN
-SHIPMENT_TYPE
-FORECAST
4.7.2) OrderMethods (3 records) contains the order method details
-ORDER_METHOD_KEY
-Order Method
4.7.3) SalesFinanceFace (4049 records) contains the sales fact details
-zEMPKEY
-Quota
-MonthYear
-Closed Revenue
-Sales Quota
-Quota %

5. QVD Processing & Data


This section will detail how the raw data imports are transformed into the data used
34 | P a g e

to build the CDP applications. The script and transformations will be documented
below.
5.0.1) Script Layout the script for the QVD builder is broken into subject
areas and the last tab being where all the QVDs are being written out.

5.1) Customers Tab: Transformations for the customer/company raw table


into QVD.
Customer:
LOAD
Floor(year(Today()) - year(dateOfBirth)) as [Customer Age Group],
date(dateOfBirth) as [Customer DOB],
lastName & ', ' & firstName as [Customer Name],
leadSource as [Customer Lead Source],
houseHoldSize as [CustomerHousehold Size],
emailDomain as [Customer Email],
ownHomeFlag as [Customer Homeowner],
maritalStatus as [Customer Marital Status],
contactPreference as [Customer Contact Preference],
annualIncome as [Customer Annual Income],

35 | P a g e

customerId as zCONTACTKEY,
accountStatus as [Customer Status],
customerTier as [Customer Tier],
"age" as [Customer Age],
educationLevel as [Customer Education Level],
gender as [Customer Gender],
emailOptOut as [Customer Email Opt Out],
ethnicity as [Customer Ethnicity],
Floor(year(Today()) - year(customerSinceDate)) as [Customer Tenure],
PostalCode as [Customer Zip/Postal],
City as [Customer City],
"State / Province" as [Customer State/Province],
Country as [Customer Country],
GeoMakePoint(Latitude, Longitude) as [Customer Geokey],
date([Status Date]) as [Customer Update Status Date]
FROM [lib://Core Data/Customer\CDPContactMaster.xlsx]
(ooxml, embedded labels, table is Contacts18372);

Company:
LOAD
marketCap as [Company Market Cap],
avgClickStreamPageDuration as [Marketing Avg Click Stream Page
Duration],
industrySector as [Company Industry],
leadSource as [Lead Source],

36 | P a g e

annualSpend as [Company Annual Spend],


eMailOptOutFlag as [Company Email Opt Out Flag],
employeeCount as [Company Employee Count],
tier as [Company Tier],
primaryChannel as [Company Primary Channel],
emailOnFile as [Company Email on File],
annualRevenue as [Company Annual Revenue],
contactChannelPreference as [Company Channel Preference],
hasTwitterHandle as [Company Twitter Handle],
companyId as zORGKEY,
webLoginDuration as [Company Web Login Duration],
Floor(year(Today()) - year(customerSinceDate)) as [Company Tenure],
date(customerSinceDate) as [Company Since Date],
Region as [Company Region],
Country as [Company Country],
GeoMakePoint(Latitude, Longitude) as [Company Lat/Long],
Zip as [Company Zip],
City as [Company City],
CompanyName as [Company Name],
StreetAddress as [Company Street Address]
FROM [lib://Core Data/Customer\CDPCustomerMaster.xlsx]
(ooxml, embedded labels, table is Int2500);

37 | P a g e

5.2) Sales Tab: Transformations for the sales and orders raw tables into
QVDs. This process also creates a Sales master calendar.

SalesFinanceFact:
LOAD
PRODUCT_KEY as zPKEY,
SALES_ORDER_KEY as zSOKEY,
date(ORDER_DAY) as [Sales Order Date],
//date#(ORDER_DAY,'YYYYMMDD') as [Sales Order Date],
QUOTA_KEY as zQKEY,
ORGANIZATION_KEY as zORGKEY,
EMPLOYEE_KEY as zEMPKEY,
CUSTOMER_KEY as zCUSTKEY,
CUSTOMER_KEY as zCONTACTKEY,
DemandPlannerID as zDemandEmpID,
PROMOTION_KEY as zPROMOKEY,
ORDER_METHOD_KEY as zOMKEY,
BRANCH_KEY as zBRKEY,

38 | P a g e

date(SHIPPING_DAY) as [Sales Ship Date],


date(CLOSE_DAY) as [Sales Close Date],
//date#(SHIPPING_DAY,'YYYYMMDD') as [Sales Ship Date],
//date#(CLOSE_DAY,'YYYYMMDD') as [Sales Close Date],
QTY_ORDERED as [Sales Quantity],
SALE_PRICE_UNIT as [Sales Price by Unit],
GROSS_MARGIN as [Sales Gross Margin],
TOTAL_SALE_REVENUE as [Sales Revenue],
//QUOTA as [Sales Quota],
// EMPLOYEE_KEY & '-' & num(date#(CLOSE_DAY,'YYYYMMDD')) as
zQUOTAKEY,
//EMPLOYEE_KEY & '-' & monthname(date#(CLOSE_DAY,'YYYYMMDD')) as
zQUOTAKEY,
EMPLOYEE_KEY & '-' & monthname(date(CLOSE_DAY)) as zQUOTAKEY,
GROSS_PROFIT as [Sales Gross Profit],
ORDER_DETAIL_LINE as [Sales Order Detail Line],
ORDER_NUMBER as [Sales Order Number],
fabs(date(SHIPPING_DAY) - date(ORDER_DAY)) as [Sales Order Days Aging],
if(fabs(date(SHIPPING_DAY) - date(ORDER_DAY)) < 3, '(1) <3',
if (fabs(date(SHIPPING_DAY) - date(ORDER_DAY)) >= 3 AND
fabs(date(SHIPPING_DAY) - date(ORDER_DAY)) <= 5, '(2) 3-5',
if (fabs(date(SHIPPING_DAY) date(ORDER_DAY,'YYYYMMDD')) > 5 AND
fabs(date(SHIPPING_DAY) - date(ORDER_DAY)) <= 10,
'(3) 5-10',
if (fabs(date(SHIPPING_DAY) - date(ORDER_DAY)) > 10
AND f
abs(date(SHIPPING_DAY) - date(ORDER_DAY)) <=
30, '(4) 10-30', '(5) >30')

39 | P a g e

)
)
)
AS [Sales Order Days Aging Bucket],

// if(fabs(date#(SHIPPING_DAY,'YYYYMMDD') date#(ORDER_DAY,'YYYYMMDD')) < 5, '(1) <5',


// if (fabs(date#(SHIPPING_DAY,'YYYYMMDD') date#(ORDER_DAY,'YYYYMMDD')) >= 5 AND
//fabs(date#(SHIPPING_DAY,'YYYYMMDD') - date#(ORDER_DAY,'YYYYMMDD'))
<= 10, '(2) 5-10',
// if (fabs(date#(SHIPPING_DAY,'YYYYMMDD') date#(ORDER_DAY,'YYYYMMDD')) > 10 AND
//fabs(date#(SHIPPING_DAY,'YYYYMMDD') - date#(ORDER_DAY,'YYYYMMDD'))
<= 25, '(3) 10-25',
// if (fabs(date#(SHIPPING_DAY,'YYYYMMDD') date#(ORDER_DAY,'YYYYMMDD')) > 25 AND
//fabs(date#(SHIPPING_DAY,'YYYYMMDD') - date#(ORDER_DAY,'YYYYMMDD'))
<= 50, '(4) 25-50',
// if (fabs(date#(SHIPPING_DAY,'YYYYMMDD') date#(ORDER_DAY,'YYYYMMDD')) > 50 AND
//fabs(date#(SHIPPING_DAY,'YYYYMMDD') - date#(ORDER_DAY,'YYYYMMDD'))
<= 100, '(5) 50-100',
//

'(6) >100')

//

//

//
//
//

)
)
AS [Sales Order Days Aging Bucket],

if(fabs(date(SHIPPING_DAY) - date(ORDER_DAY)) < 10, 'Ontime', 'Late') as

40 | P a g e

[Sales Order Status],


if(fabs(date(SHIPPING_DAY) - date(ORDER_DAY)) < 10, 1, 0) as [Sales Order
Ontime],
// if(fabs(date#(SHIPPING_DAY,'YYYYMMDD') date#(ORDER_DAY,'YYYYMMDD')) < 15, 'Ontime', 'Late') as [Sales Order
Status],
// if(fabs(date#(SHIPPING_DAY,'YYYYMMDD') date#(ORDER_DAY,'YYYYMMDD')) < 15, 1, 0) as [Sales Order Ontime],
if(RETURN = '1', TOTAL_SALE_REVENUE) as [Sales Return Revenue],
if(RETURN = '1', QTY_ORDERED) as [Sales Units Returned],
SHIPMENT_TYPE as [Sales Shipment Method],
FORECAST as [Sales Forecast],
COSTS as [Sales Costs]
FROM [lib://Core Data/Sales\SALES_FACT_UPDATE.xlsx]
(ooxml, embedded labels, table is SalesFinanceFact);

OrderMethod:
LOAD
ORDER_METHOD_KEY as zOMKEY,
"Order Method" as [Sales Order Method]
FROM [lib://Core Data/Sales\SALES_FACT_UPDATE.xlsx]
(ooxml, embedded labels, table is OrderMethods);

// Sales CALENDAR
TEMP:
LOAD

41 | P a g e

num(floor(min([Sales Order Date]))) AS MinSalesDate,


num(floor(max([Sales Order Date]))) AS MaxSalesDate
RESIDENT
SalesFinanceFact;

LET vMinSalesDate = peek('MinSalesDate', 0, 'TEMP');


LET vMaxSalesDate = peek('MaxSalesDate', 0, 'TEMP');

DROP TABLE TEMP;

DateIsland:
LOAD
date($(vMinSalesDate) + rowno() - 1) AS D,
year($(vMinSalesDate) + rowno() - 1) AS Y,
month($(vMinSalesDate) + rowno() - 1) AS M,
date(monthstart($(vMinSalesDate) + rowno() - 1), 'MMM-YYYY') AS MY
AUTOGENERATE
vMaxSalesDate - vMinSalesDate + 1;
LET vToday = vMaxSalesDate;

//Relative Time Script


SalesCalendar:
LOAD
//D AS %link_Date,

42 | P a g e

D AS [Sales Order Date],


//

Basic Date Dimensions


Y AS [Sales Year],
M AS [Sales Month],
MY AS [Sales MonthYear],
'Q' & ceil(M / 3) AS [Sales Quarter],

//

Year flags
inyear(D, '$(vToday)', 0) * -1 AS [Sales CY], //Current year
inyear(D, '$(vToday)', -1) * -1 AS [Sales LY],

//

//First prior year

Quarter flags
inquarter(D, '$(vToday)', 0) * -1 AS [Sales CQ], //Current quarter

inquarter(D, '$(vToday)', -4) * -1 AS [Sales LQ], //First prior quarter,


same quarter last year

//

Month flags
inmonth(D, '$(vToday)', 0) * -1 AS [Sales CM],

//Current month

inmonth(D, '$(vToday)', -1) * -1 AS [Sales LM]

//Previous month

RESIDENT
DateIsland;
DROP TABLE DateIsland;

43 | P a g e

5.3) Finance Tab: Transformations for the Finance TE raw tables into QVDs.

FinanceTEFact:
LOAD
Billable as [Finance T&E Billable],
EmployeeID as zEMPKEY,
"Expense Type" as [Finance T&E Type],
"Expense Category" as [Finance T&E Category],
date("Date") as [Finance T&E Date],
monthname("Date") as [Finance T&E Period],
month("Date") as [Finance T&E Month],
Quarter as [Finance T&E Quarter],
year("Date") as [Finance T&E Year],
Amount as [Finance T&E Amount],
Budget1 as [Finance T&E Budget]
FROM [lib://Core Data/Finance\Expenses.xlsx]
(ooxml, embedded labels, table is [Finance Expenses]);

44 | P a g e

FinancialPlanners:
LOAD
DemandEmplD as zDemandEmpID,
"Demand Director" as [Finance Demand Director],
"Demand Manager" as [Finance Demand Manager],
"Demand Planner" as [Finance Demand Planner]
FROM [lib://Core Data/HR\Employees.xlsx]
(ooxml, embedded labels, table is [Demand Planners]);

5.3) Pipeline Tab: Transformations for the pipeline, quotas, and competitor
raw tables into QVDs.

QuotasFacts:
LOAD
//zEMPKEY,
zEMPKEY & '-' & monthname("Sales Close Date") as zQUOTAKEY,
"Sales Close Date" as [Quota Date],
Quota as [Sales Quota]
FROM [lib://Core Data/Sales\Quotas.xlsx]
(ooxml, embedded labels, table is Quotas);

PipelineFact:
LOAD
"StartDate (subtract from Close Date)" as [Sales Duration],

45 | P a g e

CampaignID as zMarketingCampaignID,
"Sales Stage" as [Sales Stage],
IsWon as [Sales Won/Lost],
if(IsWon = '1', 'Won',
if((IsClosed = '1' AND IsWon = '0'), 'Lost',
'Open')) as [Sales Opp Status],
IsClosed as [Sales Closed],
CompetitorID as zMarketingCompetitorID,
"Stage Duration" as [Sales Stage Duration],
"Opportunity Amt" as [Sales Opportunity Amount]
FROM [lib://Core Data/Marketing\Marketing.xlsx]
(ooxml, embedded labels, table is Pipeline);

Competitors:
LOAD
CompetitorID as zMarketingCompetitorID,
Competitor
FROM [lib://Core Data/Marketing\Marketing.xlsx]
(ooxml, embedded labels, table is Competitor);

5.4) Marketing Tab: Transformations for the marketing fact, marketing


campaigns, marketing channels, and marketing referrals raw tables into
QVDs. This process also creates a marketing master calendar.

MarketingFact:

46 | P a g e

LOAD
//SALES_ORDER_KEY as zSOKEY,
CampaignID as zMarketingCampaignID,
// CUSTOMERID as zCONTACTKEY,
ReferralSourceID as zMarketingReferralSourceID,
ChannelID as zMarketingChannelID,
PageID as zMarketingPageID,
date([Campaign Response Date]) as [Marketing Date],
//
monthname([Campaign Response Date]) as [Campaign Response
Month],
//

year([Campaign Response Date]) as [Campaign Response Year],

if([Conversion Date] <> 'FALSE', date([Conversion Date])) as [Marketing


Campaign Conversion Date],
//

monthname([Conversion Date]) as [Campaign Conversion Month],

//

year([Conversion Date]) as [Campaign Conversion Year],

Floor(date([Conversion Date]) - date([Campaign Response Date])) as


[Marketing Campaign Response Days],
Visits as [Marketing Leads],
Conversions as [Marketing Conversions],
Calls as [Marketing Calls],
"Campaign Cost" as [Marketing Cost],
Visitors as [Marketing Visitors],
"Unique Visitors" as [Marketing Unique Visitors],
PageRank as [Marketing Page Rank]
FROM [lib://Core Data/Marketing\Marketing.xlsx]
(ooxml, embedded labels, table is MarketingFact);

47 | P a g e

MarketingCampaigns:
LOAD
CampaignID as zMarketingCampaignID,
"Campaign Start Date" as [Marketing Campaign Date],
"Campaign Objective" as [Marketing Campaign Objective],
"Campaign Owner" as [Marketing Owner],
"Campaign Sector" as [Marketing Sector],
"Campaign Status" as [Marketing Status],
"Campaign Sub Type" as [Marketing Campaign Sub Type],
"Campaign Theme" as [Marketing Campaign Theme],
"Campaign Topic" as [Marketing Campaign Topic],
"Campaign Type" as [Marketing Campaign Type],
"Campaign Group Employee Range" as [Marketing Campaign Target
Employee Range],
"Campaign Job Function" as [Marketing Campaign Target Job Function],
"Campaign Line of Business" as [Marketing Campaign Target LOB],
"Campaign Method" as [Marketing Method],
"Campaign Name" as [Marketing Campaign],
"Campaign Name" as [Opportunity Name],
"Campaign Influence" as [Marketing Campaign Influence],
"Campaign Owner Function" as [Marketing Owner Function]
FROM [lib://Core Data/Marketing\Marketing.xlsx]
(ooxml, embedded labels, table is Campaigns);

48 | P a g e

MarketingChannels:
LOAD
ChannelID as zMarketingChannelID,
Channel as [Marketing Channel]
FROM [lib://Core Data/Marketing\Marketing.xlsx]
(ooxml, embedded labels, table is Channel);

MarketingReferralSources:
LOAD
ReferralSourceID as zMarketingReferralSourceID,
ReferralSource as [Marketing Referral Source]
FROM [lib://Core Data/Marketing\Marketing.xlsx]
(ooxml, embedded labels, table is Leads);

Left Join (MarketingFact)


LOAD
PageID as zMarketingPageID,
Page as [Marketing Page],
Download as [Marketing Downloads]
FROM [lib://Core Data/Marketing\Marketing.xlsx]
(ooxml, embedded labels, table is Pages);

49 | P a g e

// Marketing CALENDAR

TEMP:
LOAD
num(floor(min([Marketing Date]))) AS MinCampaignDate,
num(floor(max([Marketing Date]))) AS MaxCampaignDate
RESIDENT
MarketingFact;

LET vMinCampaignDate = peek('MinCampaignDate', 0, 'TEMP');


LET vMaxCampaignDate = peek('MaxCampaignDate', 0, 'TEMP');

DROP TABLE TEMP;

DateIsland:
LOAD
date($(vMinCampaignDate) + rowno() - 1) AS D,
year($(vMinCampaignDate) + rowno() - 1) AS Y,
month($(vMinCampaignDate) + rowno() - 1) AS M,
date(monthstart($(vMinCampaignDate) + rowno() - 1), 'MMM-YYYY') AS
MY
AUTOGENERATE
vMaxCampaignDate - vMinCampaignDate + 1;

LET vToday = vMaxCampaignDate;

50 | P a g e

//Relative Time Script

MarketingCalendar:
LOAD
//D AS %link_Date,
D AS [Marketing Date],

//

Basic Date Dimensions


Y AS [Marketing Year],
M AS [Marketing Month],
MY AS [Marketing MonthYear],
'Q' & ceil(M / 3) AS [Marketing Quarter],

//

Year flags
inyear(D, '$(vToday)', 0) * -1 AS [Marketing CY],

//Current year

inyear(D, '$(vToday)', -1) * -1 AS [Marketing LY],

//First prior

year

//

Quarter flags

inquarter(D, '$(vToday)', 0) * -1 AS [Marketing CQ],


quarter

//Current

inquarter(D, '$(vToday)', -4) * -1 AS [Marketing LQ],


quarter, same quarter last year

//First prior

//

Month flags

51 | P a g e

inmonth(D, '$(vToday)', 0) * -1 AS [Marketing CM],

//Current

inmonth(D, '$(vToday)', -1) * -1 AS [Marketing LM]

//Previous

month

month

RESIDENT
DateIsland;

DROP TABLE DateIsland;

5.5) Employee Tab: Transformations for the employees tables into QVDs.
Employees:
LOAD
EmployeeID as zEMPKEY,
EmployeeName as [Employee Name],
Gender as [Employee Gender],
Area as [Employee Area],
Department as [Employee Dept],
"Business Unit" as [Employee Business Unit],
"Job Title" as [Employee Job Title],
"Employee Region" as [Employee Region],
"Employee Country" as [Employee Country],
"Employee State" as [Employee State],
"Employee City" as [Employee City],
"Date of Birth" as [Employee DOB],

52 | P a g e

date("Date of Birth") as [Employee Birth Date],


monthname("Date of Birth") as [Employee Birth Month],
Year("Date of Birth") as [Employee Birth Year],
"Job Classification" as [Employee Job Class],
Manager as [Employee Manager],
"Employment Type" as [Employee Employment Type],
Band as [Employee Band],
"Performance Rating" as [Employee Perf Rating] ,
Ethnicity as [Employee Ethnicity],
date("Hire Date") as [Employee Hire Date] ,
monthname("Hire Date") as [Employee Hire Month],
Year("Hire Date") as [Employee Hire Year],
date("Termination Date") as [Employee Termination Date],
monthname("Termination Date") as [Employee Termination Month],
Year("Termination Date") as [Employee Termination Year],
Floor(year(Today()) - Year([Date of Birth])) as [Employee Age],
Floor(Year(Today()) - Year([Hire Date])) as [Employee Tenure],
If(Active = 'Y', 1) as [Employee Active Flag],
If(Active = 'N', 1) as [Employee Inactive Flag],
"Recruitment Source" as [Employee Recruitment Source],
"Referral Source" as [Employee Referral Source],
"Termination Type" as [Employee Termination Type],
"Termination Reason" as [Employee Termination Reason],
Salary as [Employee Salary],

53 | P a g e

Compensation as [Employee Total Compensation]


FROM [lib://Core Data/HR/Employees.xlsx]
(ooxml, embedded labels, table is Employees);

Left Join (Employees)


LOAD
"Employee City",
GeoMakePoint(Latitude, Longitude) as EmployeeGeoPoint
FROM [lib://Core Data/HR\Geodata.xls]
(biff, embedded labels, table is Sheet1$);

5.6) Product Tab: Transformations for the product table into QVDs.

Product:
LOAD
PRODUCT_KEY as zPKEY,
PRODUCT_CATEGORY as [Product Category],
PRODUCT_SUBCAT as [Product Sub Category],
PRODUCT_GROUP as [Product Group],
PRODUCT_VNDR as [Product Vendor],
PRODUCT as [Product Name],
PRODUCT_MDL as [Product Model],
UNITCOST as [Product Unit Cost],
UNITPRICE as [Product Unit Price],

54 | P a g e

PRODUCTWEIGHT as [Product Weight],

if(PRODUCTWEIGHT < 5, '(1) <5',


if (PRODUCTWEIGHT >= 5 AND PRODUCTWEIGHT <= 10, '(2) 510',
if (PRODUCTWEIGHT > 10 AND PRODUCTWEIGHT <= 25,
'(3) 10-25',
if (PRODUCTWEIGHT > 25 AND PRODUCTWEIGHT
<= 50, '(4) 25-50',
if (PRODUCTWEIGHT > 50 AND
PRODUCTWEIGHT <= 100, '(5) 50-100',
'(6) >100')
)
)
)
)
AS [Product Weight Bucket]

FROM [lib://Core Data/Products\PRODUCT_DIM.xlsx]


(ooxml, embedded labels, table is Sheet);

5.7) Customer Service: Transformations for the call center and customer
service excel files into QVDs.
CallCenterFact:
LOAD
date(Date_ID) as [Call Ctr Call Date],
MonthName(Date_ID) as [Call Ctr Call Month],

55 | P a g e

Week(Date_ID) as [Call Ctr Call Week],


WeekDay(Date_ID) as [Call Ctr Call Weekday],
if(IsNull("Close Date"), 0, 1) as [Call Ctr Closed Tickets],
if(IsNull("Close Date"), 1, 0) as [Call Ctr Open Tickets],
num("Close Date") - num(Date_ID) as [Call Ctr Ticket Aging],
Agent_ID as AgentID,
//

Product_ID as PRODUCT_KEY,
timestamp(Time_ID) as [Call Ctr Call Time],
hour(Time_ID) as [Call Ctr Call Hour],
"Case #" as [Call Ctr Ticket #],
Group_ID as zGRPKEY,
Service_Type_ID as zSVCTYPEKEY,
Call_Severity_ID as zCALLSEVKEY,
Customer_ID as zORGKEY,
"# Call" as [Call Ctr Call #],
"# Completed" as [Call Ctr Completed #],
"# Terminated" as [Call Ctr Terminated #],
"# Active Agent" as [Call Ctr Active Agent #],
"Call Duration" as [Call Ctr Call Duration],
"Avg Hold Time" as [Call Ctr Avg Hold Time],
"Call Costs" as [Call Ctr Call Costs],
"Hold Time with SLA" as [Call Ctr Hold Time w/ SLA],
"Hold Time Mising SLA" as [Call Ctr Hold Time w/o SLA],
"Call Duration within SLA" as [Call Ctr Call Duration within SLA],

56 | P a g e

"Call Duration missing SLA" as [Call Ctr Call Duration no SLA],


"Satisfaction Level" as [Call Center Satisfaction Level],
"Quality Level" as [Call Center Quality Level],
"Tech Level" as [Call Center Tech Level]
FROM [lib://Core Data/Customer Service\Call Center.xlsx]
(ooxml, embedded labels, table is [Call Center Fact]);

CallCenterGroup:
LOAD
Group_ID as zGRPKEY,
"Group" as [Call Center Group]
FROM [lib://Core Data/Customer Service\Call Center.xlsx]
(ooxml, embedded labels, table is Group);

CallCenterCallType:
LOAD
Service_Type_ID as zSVCTYPEKEY,
Service_Type as [Call Center Service Type]
FROM [lib://Core Data/Customer Service\Call Center.xlsx]
(ooxml, embedded labels, table is Service_Type);

CallCenterSeverity:
LOAD
Call_Severity_ID as zCALLSEVKEY,

57 | P a g e

Call_Severity as [Call Center Severity Type]


FROM [lib://Core Data/Customer Service\Call Center.xlsx]
(ooxml, embedded labels, table is Call_Severity);

CallCenterAgents:
LOAD
EmployeeID as AgentID,
EmployeeName as [Call Ctr Agent],
"Employee Country" as [Call Ctr Country],
"Employee City" as [Call Ctr Location]
FROM [lib://Core Data/HR\Employees.xlsx]
(ooxml, embedded labels, table is Employees);

5.8) QVD Builders: This tab is what writes the conformed in-memory
tables into QVDs.
// QVDs
// Dimensions
store * from Customer into [lib://Core Data/QVDs/Dimensions/Customer.qvd];
store * from Company into [lib://Core Data/QVDs/Dimensions/Company.qvd];
store * from OrderMethod into [lib://Core
Data/QVDs/Dimensions/OrderMethod.qvd];
store * from Employees into [lib://Core
Data/QVDs/Dimensions/Employees.qvd];
store * from Product into [lib://Core Data/QVDs/Dimensions/Product.qvd];
store * from FinancialPlanners into [lib://Core
Data/QVDs/Dimensions/FinancialPlanners.qvd];

58 | P a g e

store * from Competitors into [lib://Core


Data/QVDs/Dimensions/Competitors.qvd];
store * from MarketingCampaigns into [lib://Core
Data/QVDs/Dimensions/MarketingCampaigns.qvd];
store * from MarketingChannels into [lib://Core
Data/QVDs/Dimensions/MarketingChannels.qvd];
store * from MarketingReferralSources into [lib://Core
Data/QVDs/Dimensions/MarketingReferralSources.qvd];
store * from CallCenterCallType into [lib://Core
Data/QVDs/Dimensions/CallCenterCallType.qvd];
store * from CallCenterAgents into [lib://Core
Data/QVDs/Dimensions/CallCenterAgents.qvd];
store * from CallCenterGroup into [lib://Core
Data/QVDs/Dimensions/CallCenterGroup.qvd];
store * from CallCenterSeverity into [lib://Core
Data/QVDs/Dimensions/CallCenterSeverity.qvd];

// Calendars
store * from SalesCalendar into [lib://Core
Data/QVDs/Calendar/SalesCalendar.qvd];
store * from MarketingCalendar into [lib://Core
Data/QVDs/Calendar/MarketingCalendar.qvd];

// Fact Tables
store * from SalesFinanceFact into [lib://Core
Data/QVDs/Facts/SalesFinanceFact.qvd];
store * from FinanceTEFact into [lib://Core
Data/QVDs/Facts/FinanceTEFact.qvd];
store * from MarketingFact into [lib://Core
Data/QVDs/Facts/MarketingFact.qvd];
store * from PipelineFact into [lib://Core Data/QVDs/Facts/PipelineFact.qvd];

59 | P a g e

store * from QuotasFacts into [lib://Core Data/QVDs/Facts/QuotasFact.qvd];


store * from CallCenterFact into [lib://Core
Data/QVDs/Facts/CallCenterFact.qvd];

5. Final QVD List

Below his is the list of QVDs used by the CDP applications. They are
segmented into three categories: Calendar QVDs, Dimensional QVDs, and
Fact QVDs

Dimensional QVDs
CallCenterAgents.qvd
CallCenterCallType.qvd
CallCenterGroup.qvd
CallCenterSeverity.qvd
Company.qvd
Competitors.qvd
Customer.qvd
Employees.qvd
FinancialPlanners.qvd
MarketingCampaigns.qvd
MarketingChannels.qvd
60 | P a g e

MarketingReferralSources.qvd
OrderMethod.qvd
Product.qvd

Calendars
MarketingCalendar.qvd
SalesCalendar.qvd
SalesPipelineCalendar.qvd

Fact Tables
CallCenterFact.qvd
FinanceTEFact.qvd
MarketingFact.qvd
PipelineFact.qvd
QuotasFact.qvd
SalesFinanceFact.qvd

61 | P a g e

Você também pode gostar