You need to sign in to do that
Don't have an account?
Kyle Deweerdt 6
Shortening CASE function
Hello!
I am looking for some help shortening this case function. I am trying to pull over a field that has every lead source channel tracked in it's values and I need to create this field for grouping them into their various marketing groups. There are a few explicit terms that are spelled out in the case function, but then I need an if statement to say "IF CONTAINS( the category has a "." in it (meaning it is a website url containing .com, .org) then list it in the group "Ref" ) AND IF CONTAINS( different sources that all start with "Organic - Something" and I need those all to be group into Organic), Else the Category is Offline.
My error is that the function is too big to execute (28,242 characters). Maximum size is 5,000 characters. I am unsure how this is possible because this is the most condensed version of the function I could manage.
Any help would be lovely!
CASE( RT_Category__c, "MailChimp", "Email", "Vertical Response", "Email", "Google AdWords", "Paid", "ICIMS", "Paid", "LinkedIn Paid", "Paid", "Facebook", "Social", "LinkedIn", "Social", "Web Direct", "Web", IF(CONTAINS(RT_Category__c, "Organic"), "Organic", IF(CONTAINS(RT_Category__c, "."), "Referral", "Offline")))
I am looking for some help shortening this case function. I am trying to pull over a field that has every lead source channel tracked in it's values and I need to create this field for grouping them into their various marketing groups. There are a few explicit terms that are spelled out in the case function, but then I need an if statement to say "IF CONTAINS( the category has a "." in it (meaning it is a website url containing .com, .org) then list it in the group "Ref" ) AND IF CONTAINS( different sources that all start with "Organic - Something" and I need those all to be group into Organic), Else the Category is Offline.
My error is that the function is too big to execute (28,242 characters). Maximum size is 5,000 characters. I am unsure how this is possible because this is the most condensed version of the function I could manage.
Any help would be lovely!
CASE( RT_Category__c, "MailChimp", "Email", "Vertical Response", "Email", "Google AdWords", "Paid", "ICIMS", "Paid", "LinkedIn Paid", "Paid", "Facebook", "Social", "LinkedIn", "Social", "Web Direct", "Web", IF(CONTAINS(RT_Category__c, "Organic"), "Organic", IF(CONTAINS(RT_Category__c, "."), "Referral", "Offline")))
PS: if this answers your question then hit Like and mark it as solution!
If RT_Category__c is a formula field (which is probably the culprit), check out the Tips for Reducing Formula Size (https://help.salesforce.com/help/pdfs/en/salesforce_formula_size_tipsheet.pdf) tip sheet from Salesforce Docs do what you can to reduce the compile size. If that fails, and you're using Enterprise Edition or higher, you can use a workflow field update to store the value of RT_Category__c in a field and then use that field value in your formula. Again, instructions for this are in the Tips for Reducing Formula Size tip sheet.