SlideShare a Scribd company logo
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Thanks for joining today’s webinar 
Formula and Analytics Tips & Tricks 
With Steve Molis (SteveMo)
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Safe Habah Statement
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
•Using the ISPICKVAL and CASE Functions 
•Creating an Opportunity Rollback Validation Rule 
•Using the TEXT Function to convert Picklist Values * No Animals Were Harmed in the Making of These Formulas 
> 1 way to deal with a Picklist field
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Formula and Analytics Tips & Tricks 
•How to block Account Create via Lead Convert 
•Counting Multi-Select Picklist Values* 
•Summarize Checkbox Fields 
•Create Dynamic Month to Date Reports 
* Some Animals Were Harmed in the Making of These Formulas
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Function: ISPICKVAL (aka “old faithful”) 
Description: Determines if the value of a picklist field is equal to a text literal you specify. 
Example: 
IF(ISPICKVAL(Weather, "Zombies!"), "RUN!!!", 
IF(ISPICKVAL(Weather, "HOT"), "Go Swimming", 
IF(ISPICKVAL(Weather, "WARM"), “Have a picnic", 
IF(ISPICKVAL(Weather, "COLD"), "Sit by the fire", 
"Send out for Pizza")))) 
Function: CASE 
Description: Checks a given expression against a series of values. 
Example: 
CASE(Weather, 
"Zombies!", "RUN!!!", 
"HOT", "Go Swimming", 
"WARM", “Have a picnic", 
"COLD", "Sit by the fire", 
"Send out for Pizza") 
> 1 way to deal with a Picklist field
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Business Requirement 
Prevent user from changing the Opportunity Stage to a previous Opportunity Stage 
Solution 
Use a Validation Rule to evaluate current Opportunity Stage and compare it to the previous Opportunity Stage 
Fields Referenced 
Opportunity: StageName 
Functions and Operators Used 
CASE 
PRIORVALUE 
< 
> 1 way to deal with a Picklist field
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
CASE( StageName , 
"Prospecting", 1, 
"Qualification", 2, 
"Needs Analysis", 3, 
"Value Proposition", 4, 
"Proposal/Price Quote", 5, 
"Negotiation/Review", 6, 
"Closed - Won", 7, 
"Closed - Lost", 7, 
0) 
< 
CASE(PRIORVALUE(StageName), 
"Prospecting", 1, 
"Qualification", 2, 
"Needs Analysis", 3, 
"Value Proposition", 4, 
"Proposal/Price Quote", 5, 
"Negotiation/Review", 6, 
"Closed - Won", 7, 
"Closed - Lost", 7, 
0) 
> 1 way to deal with a Picklist field
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Function: 
TEXT 
Description: 
Converts picklist values to text in Validation Rules, Formula Fields, and Workflow Field Updates. 
So that you can do stuff like this… 
> 1 way to deal with a Picklist field
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
•TEXT 
•Operators: > < = >= <= <> 
•ISBLANK 
•VALUE 
•BEGINS 
•CONTAINS 
•LEFT/RIGHT 
•FIND/SUBSTITUTE 
> 1 way to deal with a Picklist field
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Problem: 
Make a custom picklist field called “Loss Reason” required if the Opportunity Stage is Closed/Lost. 
> 1 way to deal with a Picklist field
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Solution: 
Create a Validation Rule 
Formula: 
AND( 
TEXT(StageName) = "Closed Lost", 
ISBLANK(TEXT(Loss_Reason__c))) 
> 1 way to deal with a Picklist field
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Problem: 
Calculate the Opportunity 
Discount Amount from 
Discount% (a custom 
picklist field) 
> 1 way to deal with a Picklist field
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Solution: 
Create a custom field 
Datatype: Formula 
Result: Currency 
Formula: 
Amount * 
(VALUE(TEXT( Discount_Pct__c )) / 100) 
> 1 way to deal with a Picklist field
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Tip #2: 
Create a custom Enhanced List View or Report to double-check your Formulas 
> 1 way to deal with a Picklist field
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Problem: 
Require priority 1-3 for 
any “Existing 
Customer” 
opportunities. 
> 1 way to deal with a Picklist field
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Solution: 
Create a Validation Rule 
Formula: 
AND( 
BEGINS(TEXT(Type),"Existing"), 
VALUE(TEXT( Priority__c )) > 3)) 
> 1 way to deal with a Picklist field
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Problem: 
Do not allow “Renewal” Cases for Inactive Accounts 
> 1 way to deal with a Picklist field
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Solution: Create a Validation Rule Formula: AND( Account.Active__c = FALSE, CONTAINS( TEXT(Status) , "Renewal")) 
> 1 way to deal with a Picklist field
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Problem: 
Extract the Numeric Value from the end of Picklist Values that contain mixed length text characters. 
Use Case: 
Approval Processes, Workflow Rules, Validation Rules, Formula Fields. 
> 1 way to deal with a Picklist field
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
CASE Formula: 
CASE( SLA__c , 
"Diamond 5.0", 5.0, 
"Platinum 4.0", 4.0, 
"Gold 2.5", 2.5, 
"Silver 1.5", 1.5, 
"Bronze 0.5", 0.5, 
0) 
Compiled size: 
5 Values = 326 bytes 
10 Values = 426 bytes 
Nested IF Formula: 
IF(ISPICKVAL(SLA__c ,"Diamond 5.0"), 5.0, 
IF(ISPICKVAL(SLA__c ,"Platinum 4.0"), 4.0, 
IF(ISPICKVAL(SLA__c ,"Gold 2.5"), 2.5, 
IF(ISPICKVAL(SLA__c ,"Silver 1.5"), 1.5, 
IF(ISPICKVAL(SLA__c ,"Bronze 0.5"), 0.5, 
0))))) 
Compiled size: 
5 Values = 465 bytes 
10 Values = 950 bytes 
> 1 way to deal with a Picklist field
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Solution: 
Formula: 
VALUE( RIGHT ( TEXT ( SLA__c ), 3 )) 
Compiled size: 280 bytes 
•Use the TEXT function to convert the Picklist Value to a Text String. 
•Then use the RIGHT function to extract the last 3 characters or the Text String. 
•Then use the VALUE function to convert the last 3 characters to a Numeric Value. 
> 1 way to deal with a Picklist field
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Field Name: Bottles of Beer on the Wall 
Dataype: Picklist 
100 Values: 
100 - Bottles of Beer 
99 - Bottles of Beer 
98 - Bottles of Beer 
97 - Bottles of Beer 
96 - Bottles of Beer 
95 - Bottles of Beer 
94 - Bottles of Beer … 
> 1 way to deal with a Picklist field
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Dataype: Formula 
Result: Number 
Formula: 
VALUE(TRIM(LEFT(TEXT(Bottles_of_Beer_on_the_Wall__c), 
FIND(" - ", TEXT(Bottles_of_Beer_on_the_Wall__c))))) 
Compiled size: 
ISPICKVAL = 7,602 characters 
CASE = 6,478 bytes 
TEXT = 546 bytes 
> 1 way to deal with a Picklist field
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
> 1 way to deal with a Picklist field
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Formula and Analytics Tips & Tricks 
•How to block Account Create via Lead Convert 
•Counting Multi-Select Picklist Values* 
•Summarize Checkbox Fields 
•Create Dynamic Month to Date Reports 
* Some Animals Were Harmed in the Making of These Formulas
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Prevent new Accounts during Lead Convert
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Prevent new Accounts during Lead Convert 
Business Requirement 
•Prevent user from creating new Accounts but allow them to convert Leads to new Contacts and Opportunities 
Solution 
•Use a Validation Rule to block new Account create. 
Fields Referenced (optional) 
•$Profile.Name 
•$Role.Name 
•$User.Id 
Function Used 
•ISNEW()
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Prevent new Accounts during Lead Convert 
Formula: 
AND( 
ISNEW(), 
$Profile.Name = “Sales User”)
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Counting Multi-Picklist Values 
Business Requirement 
Need to get the count of items selected from an Multi-Picklist field on the Opportunity to get the item count per Sales Rep 
Solution 
Use a Formula to evaluate the Multi-Picklist field and return a numeric value for each item selected and sum the numeric values 
Functions and Operators Used 
IF 
INCLUDES 
+
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Counting Multi-Picklist Values 
Create a custom field 
Datatype: Formula 
Return Type: Number, 0 decimals 
Formula: 
IF( INCLUDES( What_s_for_dinner__c , "Pizza"), 1, 0) + 
IF( INCLUDES( What_s_for_dinner__c , "Lobster"), 1, 0) + 
IF( INCLUDES( What_s_for_dinner__c , "Beer"), 1, 0) + 
IF( INCLUDES( What_s_for_dinner__c , "Wine"), 1, 0) + 
IF( INCLUDES( What_s_for_dinner__c , "Cake"), 1, 0) + 
IF( INCLUDES( What_s_for_dinner__c , "Ice Cream"), 1, 0)
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Counting Multi-Picklist Values
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Counting Multi-Picklist Values
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Converting Checkbox Fields for Summary Reports 
Problem 
•Display the “summarized” Opportunity Stage / Status in List Views, Reports and Dashboards. 
•Ugly Reports and Charts Solution 
•Use a Formula to evaluate IsWon and IsClosed checkbox fields and return a text value. Functions and Fields Used 
•IF 
•IsWon 
•IsClosed
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Converting Checkbox Fields for Summary Reports 
Solution: 
Custom field 
Datatype = Formula 
Result = Text 
Formula: 
IF(IsWon, "Won", 
IF(IsClosed, "Lost", 
"Open"))
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Converting Checkbox Fields for Summary Reports
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Report on Month to Date Sales 
Problem 
•Create a dynamic report of the Month to Date for opportunity trend analysis. Solution 
•Use a Formula to evaluate Close Date (Number) and compare to current day (Number) Functions and Operators Used 
•DAY 
•TODAY() 
•<=
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Report on Month-to-Date Sales 
Custom Field 
Datatype = Formula 
Result = Checkbox 
Formula 
DAY(CloseDate) <= DAY(TODAY())
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Report on Month-to-Date Sales
Copyright © Panaya 
Twitter: @panayacg 
Email: info@panayachangeguru.com 
Formula Resources 
•Introduction to Formulas - http://wiki.developerforce.com/page/An_Introduction_to_Formulas 
•Formulas Quick Reference Guide - https://na1.salesforce.com/help/pdfs/en/salesforce_formulas_cheatsheet.pdf 
•Useful Validation Rules - http://na1.salesforce.com/help/pdfs/en/salesforce_useful_validation_formulas.pdf 
•Building a Cross Object Formula - https://help.salesforce.com/HTViewHelpDoc?id=fields_creating_cross_object_advanced.htm&language=en_US

More Related Content

Similar to SteveMo Webinar: Hit a Home Run with Formula & Analytics Tricks (10)

PDF
Steve mo's formulas and life hacks wellington nz 2020-05-05
Anna Loughnan Colquhoun
 
PDF
Become a Formula Ninja
Configero
 
PDF
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
Eve Lyons-Berg
 
PDF
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
Aggregage
 
PDF
Validation Rules
AasimAbdul
 
PPTX
Introduction to Salesforce validation rules new
Omprakash Saini
 
PDF
Learn More with SteveMo - Steve Molis
Salesforce Admins
 
PDF
Revving up the Force.com Formula Engine
Salesforce Developers
 
PDF
DF16 Imprivata - Getting Started with Formulas
Christophe Rustici
 
PPTX
Salesperson Performance Analysis
Gurvinder Singh
 
Steve mo's formulas and life hacks wellington nz 2020-05-05
Anna Loughnan Colquhoun
 
Become a Formula Ninja
Configero
 
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
Eve Lyons-Berg
 
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
Aggregage
 
Validation Rules
AasimAbdul
 
Introduction to Salesforce validation rules new
Omprakash Saini
 
Learn More with SteveMo - Steve Molis
Salesforce Admins
 
Revving up the Force.com Formula Engine
Salesforce Developers
 
DF16 Imprivata - Getting Started with Formulas
Christophe Rustici
 
Salesperson Performance Analysis
Gurvinder Singh
 

More from Panaya (20)

PPTX
Comment améliorer les tests de flux transverses à vos applications métiers ?
Panaya
 
PPTX
Oracle on premises and oracle cloud - how to coexist webinar
Panaya
 
PPTX
Panaya Test Center – Auf zu postmodernem ERP Testing
Panaya
 
PPTX
SAP Security Chat Tips to Improve SAP ERP Security
Panaya
 
PPTX
Elevate to Postmodern ERP Testing
Panaya
 
PPTX
Sap security webinar- dach
Panaya
 
PPTX
Practical steps to a smooth transition to hana
Panaya
 
PPTX
Scm webinar digital transformation
Panaya
 
PPTX
Getting the Most out of SAPPHIRE NOW + ASUG 2016
Panaya
 
PPTX
Preparing for Your Oracle EBS Cloud Migration: Organizational Readiness
Panaya
 
PPTX
Behind the Magic – Your ERP Secrets Revealed
Panaya
 
PPTX
Are you putting your organization at risk?
Panaya
 
PPTX
S/4HANA Simple Finance - The C-Level Pleaser - UK Edition
Panaya
 
PPTX
The Killer Practice for All SAP Changes
Panaya
 
PPT
Understanding the value of agility in the cloud
Panaya
 
PPTX
SAP Nation 2.0 – A Realistic Market Perspective of S4/HANA Simplicity
Panaya
 
PPTX
SAP GVP Sven Denecken Kicks Off Premier Panaya-SAP S/4HANA Webinar
Panaya
 
PPTX
S4 HANA Webinar
Panaya
 
PDF
Campaign overview (1)
Panaya
 
PPTX
Master S4/HANA Webinar Series – An in-depth look at the ERP pains S4/HANA add...
Panaya
 
Comment améliorer les tests de flux transverses à vos applications métiers ?
Panaya
 
Oracle on premises and oracle cloud - how to coexist webinar
Panaya
 
Panaya Test Center – Auf zu postmodernem ERP Testing
Panaya
 
SAP Security Chat Tips to Improve SAP ERP Security
Panaya
 
Elevate to Postmodern ERP Testing
Panaya
 
Sap security webinar- dach
Panaya
 
Practical steps to a smooth transition to hana
Panaya
 
Scm webinar digital transformation
Panaya
 
Getting the Most out of SAPPHIRE NOW + ASUG 2016
Panaya
 
Preparing for Your Oracle EBS Cloud Migration: Organizational Readiness
Panaya
 
Behind the Magic – Your ERP Secrets Revealed
Panaya
 
Are you putting your organization at risk?
Panaya
 
S/4HANA Simple Finance - The C-Level Pleaser - UK Edition
Panaya
 
The Killer Practice for All SAP Changes
Panaya
 
Understanding the value of agility in the cloud
Panaya
 
SAP Nation 2.0 – A Realistic Market Perspective of S4/HANA Simplicity
Panaya
 
SAP GVP Sven Denecken Kicks Off Premier Panaya-SAP S/4HANA Webinar
Panaya
 
S4 HANA Webinar
Panaya
 
Campaign overview (1)
Panaya
 
Master S4/HANA Webinar Series – An in-depth look at the ERP pains S4/HANA add...
Panaya
 
Ad

Recently uploaded (20)

PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
introduction to computer hardware and sofeware
chauhanshraddha2007
 
PDF
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
introduction to computer hardware and sofeware
chauhanshraddha2007
 
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Ad

SteveMo Webinar: Hit a Home Run with Formula & Analytics Tricks

  • 1. Copyright © Panaya Twitter: @panayacg Email: [email protected] Thanks for joining today’s webinar Formula and Analytics Tips & Tricks With Steve Molis (SteveMo)
  • 2. Copyright © Panaya Twitter: @panayacg Email: [email protected] Safe Habah Statement
  • 3. Copyright © Panaya Twitter: @panayacg Email: [email protected] •Using the ISPICKVAL and CASE Functions •Creating an Opportunity Rollback Validation Rule •Using the TEXT Function to convert Picklist Values * No Animals Were Harmed in the Making of These Formulas > 1 way to deal with a Picklist field
  • 4. Copyright © Panaya Twitter: @panayacg Email: [email protected] Formula and Analytics Tips & Tricks •How to block Account Create via Lead Convert •Counting Multi-Select Picklist Values* •Summarize Checkbox Fields •Create Dynamic Month to Date Reports * Some Animals Were Harmed in the Making of These Formulas
  • 5. Copyright © Panaya Twitter: @panayacg Email: [email protected] Function: ISPICKVAL (aka “old faithful”) Description: Determines if the value of a picklist field is equal to a text literal you specify. Example: IF(ISPICKVAL(Weather, "Zombies!"), "RUN!!!", IF(ISPICKVAL(Weather, "HOT"), "Go Swimming", IF(ISPICKVAL(Weather, "WARM"), “Have a picnic", IF(ISPICKVAL(Weather, "COLD"), "Sit by the fire", "Send out for Pizza")))) Function: CASE Description: Checks a given expression against a series of values. Example: CASE(Weather, "Zombies!", "RUN!!!", "HOT", "Go Swimming", "WARM", “Have a picnic", "COLD", "Sit by the fire", "Send out for Pizza") > 1 way to deal with a Picklist field
  • 6. Copyright © Panaya Twitter: @panayacg Email: [email protected] Business Requirement Prevent user from changing the Opportunity Stage to a previous Opportunity Stage Solution Use a Validation Rule to evaluate current Opportunity Stage and compare it to the previous Opportunity Stage Fields Referenced Opportunity: StageName Functions and Operators Used CASE PRIORVALUE < > 1 way to deal with a Picklist field
  • 7. Copyright © Panaya Twitter: @panayacg Email: [email protected] CASE( StageName , "Prospecting", 1, "Qualification", 2, "Needs Analysis", 3, "Value Proposition", 4, "Proposal/Price Quote", 5, "Negotiation/Review", 6, "Closed - Won", 7, "Closed - Lost", 7, 0) < CASE(PRIORVALUE(StageName), "Prospecting", 1, "Qualification", 2, "Needs Analysis", 3, "Value Proposition", 4, "Proposal/Price Quote", 5, "Negotiation/Review", 6, "Closed - Won", 7, "Closed - Lost", 7, 0) > 1 way to deal with a Picklist field
  • 8. Copyright © Panaya Twitter: @panayacg Email: [email protected] Function: TEXT Description: Converts picklist values to text in Validation Rules, Formula Fields, and Workflow Field Updates. So that you can do stuff like this… > 1 way to deal with a Picklist field
  • 9. Copyright © Panaya Twitter: @panayacg Email: [email protected] •TEXT •Operators: > < = >= <= <> •ISBLANK •VALUE •BEGINS •CONTAINS •LEFT/RIGHT •FIND/SUBSTITUTE > 1 way to deal with a Picklist field
  • 10. Copyright © Panaya Twitter: @panayacg Email: [email protected] Problem: Make a custom picklist field called “Loss Reason” required if the Opportunity Stage is Closed/Lost. > 1 way to deal with a Picklist field
  • 11. Copyright © Panaya Twitter: @panayacg Email: [email protected] Solution: Create a Validation Rule Formula: AND( TEXT(StageName) = "Closed Lost", ISBLANK(TEXT(Loss_Reason__c))) > 1 way to deal with a Picklist field
  • 12. Copyright © Panaya Twitter: @panayacg Email: [email protected] Problem: Calculate the Opportunity Discount Amount from Discount% (a custom picklist field) > 1 way to deal with a Picklist field
  • 13. Copyright © Panaya Twitter: @panayacg Email: [email protected] Solution: Create a custom field Datatype: Formula Result: Currency Formula: Amount * (VALUE(TEXT( Discount_Pct__c )) / 100) > 1 way to deal with a Picklist field
  • 14. Copyright © Panaya Twitter: @panayacg Email: [email protected] Tip #2: Create a custom Enhanced List View or Report to double-check your Formulas > 1 way to deal with a Picklist field
  • 15. Copyright © Panaya Twitter: @panayacg Email: [email protected] Problem: Require priority 1-3 for any “Existing Customer” opportunities. > 1 way to deal with a Picklist field
  • 16. Copyright © Panaya Twitter: @panayacg Email: [email protected] Solution: Create a Validation Rule Formula: AND( BEGINS(TEXT(Type),"Existing"), VALUE(TEXT( Priority__c )) > 3)) > 1 way to deal with a Picklist field
  • 17. Copyright © Panaya Twitter: @panayacg Email: [email protected] Problem: Do not allow “Renewal” Cases for Inactive Accounts > 1 way to deal with a Picklist field
  • 18. Copyright © Panaya Twitter: @panayacg Email: [email protected] Solution: Create a Validation Rule Formula: AND( Account.Active__c = FALSE, CONTAINS( TEXT(Status) , "Renewal")) > 1 way to deal with a Picklist field
  • 19. Copyright © Panaya Twitter: @panayacg Email: [email protected] Problem: Extract the Numeric Value from the end of Picklist Values that contain mixed length text characters. Use Case: Approval Processes, Workflow Rules, Validation Rules, Formula Fields. > 1 way to deal with a Picklist field
  • 20. Copyright © Panaya Twitter: @panayacg Email: [email protected] CASE Formula: CASE( SLA__c , "Diamond 5.0", 5.0, "Platinum 4.0", 4.0, "Gold 2.5", 2.5, "Silver 1.5", 1.5, "Bronze 0.5", 0.5, 0) Compiled size: 5 Values = 326 bytes 10 Values = 426 bytes Nested IF Formula: IF(ISPICKVAL(SLA__c ,"Diamond 5.0"), 5.0, IF(ISPICKVAL(SLA__c ,"Platinum 4.0"), 4.0, IF(ISPICKVAL(SLA__c ,"Gold 2.5"), 2.5, IF(ISPICKVAL(SLA__c ,"Silver 1.5"), 1.5, IF(ISPICKVAL(SLA__c ,"Bronze 0.5"), 0.5, 0))))) Compiled size: 5 Values = 465 bytes 10 Values = 950 bytes > 1 way to deal with a Picklist field
  • 21. Copyright © Panaya Twitter: @panayacg Email: [email protected] Solution: Formula: VALUE( RIGHT ( TEXT ( SLA__c ), 3 )) Compiled size: 280 bytes •Use the TEXT function to convert the Picklist Value to a Text String. •Then use the RIGHT function to extract the last 3 characters or the Text String. •Then use the VALUE function to convert the last 3 characters to a Numeric Value. > 1 way to deal with a Picklist field
  • 22. Copyright © Panaya Twitter: @panayacg Email: [email protected] Field Name: Bottles of Beer on the Wall Dataype: Picklist 100 Values: 100 - Bottles of Beer 99 - Bottles of Beer 98 - Bottles of Beer 97 - Bottles of Beer 96 - Bottles of Beer 95 - Bottles of Beer 94 - Bottles of Beer … > 1 way to deal with a Picklist field
  • 23. Copyright © Panaya Twitter: @panayacg Email: [email protected] Dataype: Formula Result: Number Formula: VALUE(TRIM(LEFT(TEXT(Bottles_of_Beer_on_the_Wall__c), FIND(" - ", TEXT(Bottles_of_Beer_on_the_Wall__c))))) Compiled size: ISPICKVAL = 7,602 characters CASE = 6,478 bytes TEXT = 546 bytes > 1 way to deal with a Picklist field
  • 24. Copyright © Panaya Twitter: @panayacg Email: [email protected] > 1 way to deal with a Picklist field
  • 25. Copyright © Panaya Twitter: @panayacg Email: [email protected] Formula and Analytics Tips & Tricks •How to block Account Create via Lead Convert •Counting Multi-Select Picklist Values* •Summarize Checkbox Fields •Create Dynamic Month to Date Reports * Some Animals Were Harmed in the Making of These Formulas
  • 26. Copyright © Panaya Twitter: @panayacg Email: [email protected] Prevent new Accounts during Lead Convert
  • 27. Copyright © Panaya Twitter: @panayacg Email: [email protected] Prevent new Accounts during Lead Convert Business Requirement •Prevent user from creating new Accounts but allow them to convert Leads to new Contacts and Opportunities Solution •Use a Validation Rule to block new Account create. Fields Referenced (optional) •$Profile.Name •$Role.Name •$User.Id Function Used •ISNEW()
  • 28. Copyright © Panaya Twitter: @panayacg Email: [email protected] Prevent new Accounts during Lead Convert Formula: AND( ISNEW(), $Profile.Name = “Sales User”)
  • 29. Copyright © Panaya Twitter: @panayacg Email: [email protected] Counting Multi-Picklist Values Business Requirement Need to get the count of items selected from an Multi-Picklist field on the Opportunity to get the item count per Sales Rep Solution Use a Formula to evaluate the Multi-Picklist field and return a numeric value for each item selected and sum the numeric values Functions and Operators Used IF INCLUDES +
  • 30. Copyright © Panaya Twitter: @panayacg Email: [email protected] Counting Multi-Picklist Values Create a custom field Datatype: Formula Return Type: Number, 0 decimals Formula: IF( INCLUDES( What_s_for_dinner__c , "Pizza"), 1, 0) + IF( INCLUDES( What_s_for_dinner__c , "Lobster"), 1, 0) + IF( INCLUDES( What_s_for_dinner__c , "Beer"), 1, 0) + IF( INCLUDES( What_s_for_dinner__c , "Wine"), 1, 0) + IF( INCLUDES( What_s_for_dinner__c , "Cake"), 1, 0) + IF( INCLUDES( What_s_for_dinner__c , "Ice Cream"), 1, 0)
  • 31. Copyright © Panaya Twitter: @panayacg Email: [email protected] Counting Multi-Picklist Values
  • 32. Copyright © Panaya Twitter: @panayacg Email: [email protected] Counting Multi-Picklist Values
  • 33. Copyright © Panaya Twitter: @panayacg Email: [email protected] Converting Checkbox Fields for Summary Reports Problem •Display the “summarized” Opportunity Stage / Status in List Views, Reports and Dashboards. •Ugly Reports and Charts Solution •Use a Formula to evaluate IsWon and IsClosed checkbox fields and return a text value. Functions and Fields Used •IF •IsWon •IsClosed
  • 34. Copyright © Panaya Twitter: @panayacg Email: [email protected] Converting Checkbox Fields for Summary Reports Solution: Custom field Datatype = Formula Result = Text Formula: IF(IsWon, "Won", IF(IsClosed, "Lost", "Open"))
  • 35. Copyright © Panaya Twitter: @panayacg Email: [email protected] Converting Checkbox Fields for Summary Reports
  • 36. Copyright © Panaya Twitter: @panayacg Email: [email protected] Report on Month to Date Sales Problem •Create a dynamic report of the Month to Date for opportunity trend analysis. Solution •Use a Formula to evaluate Close Date (Number) and compare to current day (Number) Functions and Operators Used •DAY •TODAY() •<=
  • 37. Copyright © Panaya Twitter: @panayacg Email: [email protected] Report on Month-to-Date Sales Custom Field Datatype = Formula Result = Checkbox Formula DAY(CloseDate) <= DAY(TODAY())
  • 38. Copyright © Panaya Twitter: @panayacg Email: [email protected] Report on Month-to-Date Sales
  • 39. Copyright © Panaya Twitter: @panayacg Email: [email protected] Formula Resources •Introduction to Formulas - http://wiki.developerforce.com/page/An_Introduction_to_Formulas •Formulas Quick Reference Guide - https://na1.salesforce.com/help/pdfs/en/salesforce_formulas_cheatsheet.pdf •Useful Validation Rules - http://na1.salesforce.com/help/pdfs/en/salesforce_useful_validation_formulas.pdf •Building a Cross Object Formula - https://help.salesforce.com/HTViewHelpDoc?id=fields_creating_cross_object_advanced.htm&language=en_US