You need to sign in to do that
Don't have an account?
Alan Monk 10
Case Grade formula field
I am trying to create a formula field from values from a picklist field. I am new to formulas so need some help. Basically I want to display a Letter in the field that match a certain value alone these lines.
IF(ISPICKVAL( Quality_Grade__c , "A = no errors"), 'A',
IF(ISPICKVAL(Quality_Grade__c,"B = 1 minor"), 'B',
IF(ISPICKVAL(Quality_Grade__c,"C = 2 minors"), 'C',
IF(ISPICKVAL(Quality_Grade__c,"D = 3 minors"), 'D'
IF(ISPICKVAL(Quality_Grade__c, "E = 4 minors OR 1 or more severes"), 'E'))
IF(ISPICKVAL( Quality_Grade__c , "A = no errors"), 'A',
IF(ISPICKVAL(Quality_Grade__c,"B = 1 minor"), 'B',
IF(ISPICKVAL(Quality_Grade__c,"C = 2 minors"), 'C',
IF(ISPICKVAL(Quality_Grade__c,"D = 3 minors"), 'D'
IF(ISPICKVAL(Quality_Grade__c, "E = 4 minors OR 1 or more severes"), 'E'))
IF ( ISBLANK( TEXT(Quality_Grade__c)), 'A', LEFT( TEXT( Quality_Grade__c) , 1))
Regards
All Answers
Could you post all the exact values of your picklist? (labels: "no errors", "1 minor" ... "4 minors" and "1 or more severes" only?)
Regards
A = no errors
B = 1 minor
C = 2 minors
D = 3 minors
E = 4 minors OR 1 or more severes
LEFT( TEXT( Quality_Grade__c) , 1)
Regards
IF ( ISBLANK( TEXT(Quality_Grade__c)), 'A', LEFT( TEXT( Quality_Grade__c) , 1))
Regards
CASE ( Text (Quality_Grade__c ),
"A = no errors", "A",
"B = 1 minor", "B",
"C = 2 minors", "C",
"D = 3 minors", "D",
"E = 4 minors OR 1 or more severes","E",
null )
.
ISPICKVAL and TEXT are often interchangeable for a picklist but we prefer TEXT according the last documentation.
Tips: Picklist fields are supported in TEXT functions used in these kinds of formulas: validation rules, approval rules, approval step rules, workflow rules, escalation rules, assignment rules, auto-response rules, formula fields, field updates, and custom buttons and links.
In other formulas, use ISPICKVAL or CASE when referencing a picklist field.
https://help.salesforce.com/articleView?id=customize_functions_i_z.htm&language=en&type=0
TEXT and CASE are the good practices.
Thank you for the points and with the next one.