You need to sign in to do that
Don't have an account?
MadChemist
Problem with CASE formula....
I am pretty new to using Sforce custom fields, but pretty experienced with computer jargon....Can someone tell me why this error (Error: Incorrect number of parameters for function CASE(). Expected 6, received 7) is happening in the following formula and how I can fix it.
Code:
What I am trying to do is have a picklist value return a number so I can multiply two picklist values together to obtain a number. The picklist values are Low, Moderate, High for both frequency and severity. I want to multiply the values to obtain an Impact Score....thanks!
CASE( Frequency__c , IF( ISPICKVAL( Frequency__c , "Low") , 1, 0) , 1, IF( ISPICKVAL( Frequency__c , "Moderate") , 2, 0), 2,IF( ISPICKVAL( Frequency__c , "High") , 3, 0),3) * CASE( Severity__c , IF( ISPICKVAL( Severity__c , "Low") , 2, 0), 2, IF( ISPICKVAL( Severity__c , "Moderate") , 3, 0) , 3,IF( ISPICKVAL( Severity__c , "High") , 5, 0),5)
What I am trying to do is have a picklist value return a number so I can multiply two picklist values together to obtain a number. The picklist values are Low, Moderate, High for both frequency and severity. I want to multiply the values to obtain an Impact Score....thanks!
I followed the suggested revised formula for a similar formula field and am getting a different error. How can I fix the error?
CASE (Pipeline_Size_Range__c, "$0 - $50k", $50k, "$50k - $250k",$50k,"$250k - $500k",$250k,"$500k - $1M",$500k,"$1M - $3M",$1M,0)
Error: Field $500k does not exist. Check spelling.
I have copied and pasted all field values from SFDC.
Wanted results:
If picklist value = $0k-$50k, then returned value = $50k
If picklist value = $50k-$250k, then returned value = $50k
If picklist value = $250k-$500k, then returned value = $250k
....and so on and so on...I want to calculate the lowest value of the range (with the exception of $0-$50k). Should I be using a different formula?
Since the values are not numbers in this case...you have to include them in quotes
CASE (Pipeline_Size_Range__c, "$0 - $50k", "$50k", "$50k - $250k","$50k","$250k - $500k","$250k","$500k - $1M","$500k","$1M - $3M","$1M",0)
If double quotes " " don't work try single quotes ' '
CASE (Pipeline_Size_Range__c, "$0 - $50k", '$50k', "$50k - $250k",'$50k',"$250k - $500k",'$250k',"$500k - $1M",'$500k',"$1M - $3M",'$1M',0)
Kaushik
I tried both options and still getting an error.
Error: Incorrect parameter for function CASE(). Expected , received NumberError: Incorrect parameter for function CASE(). Expected , received Number
I also tried the following formula:
CASE (Pipeline_Size_Range__c, "$0 - $50k", "50,000", "$50k - $250k","50,000","$250k - $500k","250,000","$500k - $1M","500,000","$1M - $3M","1,000,000",0)
I'm trying to return a currency value, so I thought I'd try taking out the "$" and "k". no luck. Getting the same error even when I try to return a text or number value.
Any other suggestions? Thanks!
The problem is ,when you use the currency return type you shouldn't use " ," in the numbers.Just use a regular number.
Make sure you create a formula field with Currency as the return type and use the formula that is below
CASE ( Pipeline_Size_Range__c , "$0 - $50k", 50000, "$50k - $250k",50000,"$250k - $500k",250000,"$500k - $1M",500000,"$1M - $3M",1000000,0)
Kaushik
Found the solution! We were close. Thanks for your help.
Case(Pipeline_Size_Range__c,"$0 - $50k",50000,"$50k - $250k",50000,"$250k - $500k",250000,"$500k - $1M",500000,"$1M - $3M",1000000,0)