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

PPTX
The Power of One by Steve Molis
PDF
Formula Ninja at Dreamforce 2014
PDF
Salesforce interview-preparation-toolkit-formula-and-validation-rules-in-sale...
PDF
Les formules et moi, ça fait 3!
PDF
Salesforce interview preparation toolkit formula and validation rules in sale...
PDF
Steve mo's formulas and life hacks frankfurt de 2020-05-07
PDF
100 sample formulas_v6
PDF
Sales force class-3
The Power of One by Steve Molis
Formula Ninja at Dreamforce 2014
Salesforce interview-preparation-toolkit-formula-and-validation-rules-in-sale...
Les formules et moi, ça fait 3!
Salesforce interview preparation toolkit formula and validation rules in sale...
Steve mo's formulas and life hacks frankfurt de 2020-05-07
100 sample formulas_v6
Sales force class-3

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
PDF
Become a Formula Ninja
PDF
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
PDF
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
PDF
Validation Rules
PPTX
Introduction to Salesforce validation rules new
PDF
Learn More with SteveMo - Steve Molis
PDF
Revving up the Force.com Formula Engine
PDF
DF16 Imprivata - Getting Started with Formulas
PPTX
Salesperson Performance Analysis
Steve mo's formulas and life hacks wellington nz 2020-05-05
Become a Formula Ninja
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
Validation Rules
Introduction to Salesforce validation rules new
Learn More with SteveMo - Steve Molis
Revving up the Force.com Formula Engine
DF16 Imprivata - Getting Started with Formulas
Salesperson Performance Analysis
Ad

More from Panaya (20)

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

Recently uploaded (20)

PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
1. Introduction to Computer Programming.pptx
PPTX
Tartificialntelligence_presentation.pptx
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
A Presentation on Touch Screen Technology
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
A Presentation on Artificial Intelligence
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Heart disease approach using modified random forest and particle swarm optimi...
MIND Revenue Release Quarter 2 2025 Press Release
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
gpt5_lecture_notes_comprehensive_20250812015547.pdf
1. Introduction to Computer Programming.pptx
Tartificialntelligence_presentation.pptx
Hindi spoken digit analysis for native and non-native speakers
Unlocking AI with Model Context Protocol (MCP)
Zenith AI: Advanced Artificial Intelligence
A Presentation on Touch Screen Technology
A comparative analysis of optical character recognition models for extracting...
Univ-Connecticut-ChatGPT-Presentaion.pdf
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
OMC Textile Division Presentation 2021.pptx
1 - Historical Antecedents, Social Consideration.pdf
Programs and apps: productivity, graphics, security and other tools
A Presentation on Artificial Intelligence
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Heart disease approach using modified random forest and particle swarm optimi...

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

  • 1. Copyright © Panaya Twitter: @panayacg Email: info@panayachangeguru.com Thanks for joining today’s webinar Formula and Analytics Tips & Tricks With Steve Molis (SteveMo)
  • 2. Copyright © Panaya Twitter: @panayacg Email: info@panayachangeguru.com Safe Habah Statement
  • 3. 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
  • 4. 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
  • 5. 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
  • 6. 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
  • 7. 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
  • 8. 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
  • 9. 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
  • 10. 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
  • 11. 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
  • 12. 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
  • 13. 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
  • 14. 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
  • 15. 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
  • 16. 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
  • 17. 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
  • 18. 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
  • 19. 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
  • 20. 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
  • 21. 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
  • 22. 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
  • 23. 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
  • 24. Copyright © Panaya Twitter: @panayacg Email: info@panayachangeguru.com > 1 way to deal with a Picklist field
  • 25. 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
  • 26. Copyright © Panaya Twitter: @panayacg Email: info@panayachangeguru.com Prevent new Accounts during Lead Convert
  • 27. 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()
  • 28. Copyright © Panaya Twitter: @panayacg Email: info@panayachangeguru.com Prevent new Accounts during Lead Convert Formula: AND( ISNEW(), $Profile.Name = “Sales User”)
  • 29. 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 +
  • 30. 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)
  • 31. Copyright © Panaya Twitter: @panayacg Email: info@panayachangeguru.com Counting Multi-Picklist Values
  • 32. Copyright © Panaya Twitter: @panayacg Email: info@panayachangeguru.com Counting Multi-Picklist Values
  • 33. 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
  • 34. 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"))
  • 35. Copyright © Panaya Twitter: @panayacg Email: info@panayachangeguru.com Converting Checkbox Fields for Summary Reports
  • 36. 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() •<=
  • 37. 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())
  • 38. Copyright © Panaya Twitter: @panayacg Email: info@panayachangeguru.com Report on Month-to-Date Sales
  • 39. 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