I have a picklist field called Endeavor Office where the options are usually countries like "Brazil". However some offices have sub offices so it looks like "Mexico - Puebla". In order to group these I created a formula called Endeavo Office - Group that drops anything after the first word so "Mexico - Puebla" comes out as just "Mexico".
Here is the Code:
IF(
CONTAINS(TEXT(Endeavor_Office__c), "-"),
LEFT(TEXT(Endeavor_Office__c),FIND(" -", TEXT(Endeavor_Office__c))),
(TEXT (Endeavor_Office__c))
)
The code works great the issue is the text from the formulas no longer group. (See image)
Notice that the Endeavor Office Group for Colombia shows the same? Even though it's exactly the same?
I've also put the text in Word to makee sure the spacing was the same. and it's exactly the same
Thoughts?
4 réponses
How about this:
IF(
CONTAINS(TEXT(Endeavor_Office__c), "-"),
TRIM(LEFT(TEXT(Endeavor_Office__c),FIND(" -", TEXT(Endeavor_Office__c)))),
TEXT(Endeavor_Office__c)
)