increasing reporting value with statistics
DESCRIPTION
TRANSCRIPT
1
Increasing Reporting Value with Statistics
Safe Harbor
I've always said to anyone that will listen to me (which is not very many) that software is an art form. It attracts artists.
Just look at any software company and the amount of musicians, artists, carpenters, etc…working there that create code for a living and create other things in their down time.
- Steve Lacey
2
Statistics is the study of the collection, organization, analysis, and interpretation of data. It deals with all aspects of this, including the planning of data collection in terms of the design of surveys and experiments.
- From wikipedia, the free encyclopedia
Why is this important
4 out of 5 dentists…On a scale
of 1 to 10…
Lead ScoringData
quality
indicator
3
salesforce
• Lead Scoring• Contact Scoring• Data Quality Indicators• Deal sizes• Wait times• Call volume• New customers• …….
Statistics 101
• Analysis of information– Sum
– Average
– Minimum
– Maximum
• Distribution– Normal
– Skewed
– Standard Deviation
available in salesforce
4
Normal Distribution
Skewed
5
HELP!!!
Lead Scoring
• e-mail – 10 points• Company size, industry – 10 points• Location – 10, 20 or 30 points• Phone – 30 points• Lead source – 5–15 points• Other information – 5-15 points• Job title – 15 points
• What is a good score?
6
Analysis of lead scores
• 1000 leads per week
• Who are my top 10%?
• Data quality – bottom 20%
• How do I know who to follow-up with?
I have an Idea !
7
1000 leads…
• 700 leads about average
• 125 leads above average
• 25-30 leads top tier
How do we do this in salesforce?
• Lead Object– Add a scoring process / field– Add ranking – Create a queue
• Campaign– Add lead count / average– Add standard deviation - NEW– Triggers to update campaign (or lead)
statistics
8
Standard Deviation
• Measurement of difference between the average and each observation
• There are some limitations
• Not natively calculated by salesforce
Let’s make this easy
• Deviation = the “difference between observation and average” = lead score – campaign average
• Sum of expected squared deviation
• Take the average
9
leadData = [Select id, TV_points__c from Lead where campaign__c =:cmpang.Id];
for (Lead l:leadData) {lCount ++;lValue += l.TV_points__c;
}if (lCount > 1) {
lAverage = lValue / lCount;
for (Lead l:leadData) {lVariance = (l.TV_points__c - lAverage);lVarTot += lVariance * lVariance;
}lVarAvg = lVarTot / (lCount - 1);
***
APEX Code
Approximate the square root
lVarAvg
10
Approximate the square root
lVarAvg
Use interval halving
Square root of 10 = 3.1623
.0049.993.1603.1643.15411
.00210.003.1623.1643.16012
10
9
8
7
6
5
4
3
2
1
.019.953.1543.1643.145
.029.893.1453.1643.125
.0410.013.1643.2033.125
.0810.263.2033.2813.125
.1610.773.2813.4383.125
.3111.823.4383.7503.125
.629.773.1253.752.50
1.2514.063.7552.50
2.56.252.550
5255100
max –half
estimatehalfmaxmin
11
APEX Code, cont
sMin = 0;sMax = lAverage;stdDev = (sMin + sMax) / 2 ;
while (sMax - stdDev > .01) {if (stdDev * stdDev > lVarAvg) {
sMax=stdDev;} else {
sMin=stdDev;}stdDev = (sMin + sMax) / 2 ;
}
Wrap it up
• Average = lAverage
• Standard Deviation = stdDev
• Above Average = lAverage + stdDev
• Top Tier = lAverage + 2 * stdDev
12
Next Steps
• Use a lead trigger?
or
• A campaign trigger?
• Create the business rules and queue(s)
• Don’t forget the 70%