You need to sign in to do that
Don't have an account?

Removing Last Word of String
Hey guys,
How could I add some logic into this formula to remove the last "and" of every string. It's a multi-select-picklist. I know how to do this in a new formula using left(len()-4) and referring to the field, but how could this be done all in this same formula field? (trying to save some syntax size) Here's the formula:
IF(INCLUDES(Strategy__c, "A"), "A, and", NULL)+ IF(INCLUDES(Strategy__c, "B"), "B, and ", NULL)+ IF(INCLUDES(Strategy__c, "C"), "C, and", NULL) + IF(INCLUDES(Strategy__c, "D"), "D, and ", NULL) + IF(INCLUDES(Strategy__c, "E"), "E, and ", NULL) + IF(INCLUDES(Strategy__c, "F"), "F, and ", NULL) + IF(INCLUDES(Strategy__c, "G"), "G, and", NULL) + IF(INCLUDES(Strategy__c, "H"), "H, and" NULL) + IF(INCLUDES(Strategy__c, "I"), "I, and ", NULL) + IF(INCLUDES(Strategy__c, "J"), "J, and ", NULL) + IF(INCLUDES(Strategy__c, "K"), "K, and ", NULL) + IF(INCLUDES(Strategy__c, "L"), "L, and ", NULL) + IF(INCLUDES(Strategy__c, "M"), "M, and ", NULL) + IF(INCLUDES(Strategy__c, "N"), "N, and ", NULL) + IF(INCLUDES(Strategy__c, "O"), "O, and ", NULL) + IF(INCLUDES(Strategy__c, "P"), "P, and ", NULL)
Thanks!!
How could I add some logic into this formula to remove the last "and" of every string. It's a multi-select-picklist. I know how to do this in a new formula using left(len()-4) and referring to the field, but how could this be done all in this same formula field? (trying to save some syntax size) Here's the formula:
IF(INCLUDES(Strategy__c, "A"), "A, and", NULL)+ IF(INCLUDES(Strategy__c, "B"), "B, and ", NULL)+ IF(INCLUDES(Strategy__c, "C"), "C, and", NULL) + IF(INCLUDES(Strategy__c, "D"), "D, and ", NULL) + IF(INCLUDES(Strategy__c, "E"), "E, and ", NULL) + IF(INCLUDES(Strategy__c, "F"), "F, and ", NULL) + IF(INCLUDES(Strategy__c, "G"), "G, and", NULL) + IF(INCLUDES(Strategy__c, "H"), "H, and" NULL) + IF(INCLUDES(Strategy__c, "I"), "I, and ", NULL) + IF(INCLUDES(Strategy__c, "J"), "J, and ", NULL) + IF(INCLUDES(Strategy__c, "K"), "K, and ", NULL) + IF(INCLUDES(Strategy__c, "L"), "L, and ", NULL) + IF(INCLUDES(Strategy__c, "M"), "M, and ", NULL) + IF(INCLUDES(Strategy__c, "N"), "N, and ", NULL) + IF(INCLUDES(Strategy__c, "O"), "O, and ", NULL) + IF(INCLUDES(Strategy__c, "P"), "P, and ", NULL)
Thanks!!
Multi pick list field has : Apples, Bananas, Carrots as options
Your formula field displays Apples, and or maybe Bananas, and Carrots, and dependent on options selected?
And you want instead to see Apples or Bananas and Carrots ?
Why not wrap the entire formula in the left(len( long formula here )-4) ? Not tested but i think it would work.
Regards
Andrew G
in which case, perhaps have field_1 with long formula
and then
LEFT( field_1, LEN( field_1 ) - 6 )
The thing which you want that can be done with trigger easily.
Thanks,
Jolly Birdi