function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rachel Sommer-MayerRachel Sommer-Mayer 

Assistance with building a formula field

Hey All,

I have a bad case of the mondays and I AM STUCK. Need assistance building out a formula field.It would be a percent field 
I want the formula to say:
IF Targeting_Lines_of_Business__c = "Property" (this is a picklist field) then
Case(TEXT( Responsible_OE__c ),
"Austria", 0.541,
"Belgium", 0.89,
"Brazil", 0.87,
"Canada", 0.451,
"China", 1,
"Eastern Europe", 1,
"France", 1,
"Germany", 0.87,
"Hong Kong", 0.891,
"India", 1,
"Ireland", 1,
"Italy",1,
"Japan", 0.983,
"MENA", 1,
"Netherlands", 0.978,
"Nordic", 1,
"Pacific - Australia" , 1,
"Pacific - New Zealand", 1,
"Portugal", 0.988,
"Russia", 1,
"Singapore", 0.964,
"South Africa", 0.918,
"Spain", 0.988,
"Sweden", 1,
"Switzerland",0.511,
"Turkey",1,
"UK", 0.879,
"USA", 0.936,

0

IF Targeting_Lines_of_Business__c ≠ "Property" then all Responsible_OE__c = 1

Does that make sense?! I'm stuck!

THANKS!
Tom MayroseTom Mayrose
This might work.    Try this in your new percentage formula field.
 
It is basically an If statement  [ IF(logical_test, value_if_true, value_if_false) ] with your case statement if it is true and if not true then setting
Responsible_OE__c = 1.
 
Since Targeting_Lines_of_Business__c, is a pick list you have to use the ISPICKVAL function to evaluate for "Property".   FYI...you may need to substitute the single quotes for double quotes around Property if you get a syntax error.
 
Also I'm assuming that your two custom objects are related some how.
 
IF(ISPICKVAL(Targeting_Lines_of_Business__c, "Property"),
Case(TEXT( Responsible_OE__c ),
"Austria", 0.541,
"Belgium", 0.89,
"Brazil", 0.87,
"Canada", 0.451,
"China", 1,
"Eastern Europe", 1,
"France", 1,
"Germany", 0.87,
"Hong Kong", 0.891,
"India", 1,
"Ireland", 1,
"Italy",1,
"Japan", 0.983,
"MENA", 1,
"Netherlands", 0.978,
"Nordic", 1,
"Pacific - Australia" , 1,
"Pacific - New Zealand", 1,
"Portugal", 0.988,
"Russia", 1,
"Singapore", 0.964,
"South Africa", 0.918,
"Spain", 0.988,
"Sweden", 1,
"Switzerland",0.511,
"Turkey",1,
"UK", 0.879,
"USA", 0.936,
 
0,
 
 Responsible_OE__c = 1)