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
Ravi kumar 292Ravi kumar 292 

How to get the Formula Field

Hi all,

I have a scenario.. I have a Picklist Some__c. based on the Picklist value i need to display the Interest Rates like 10%, 11%, 12%, etc.. Here i need to display for one Picklist there are different interest rates.. For Example: For 'A' picklist value i need to display 10% and 12%.

How can i achieve this.

Help on this. Thanks in advance.. 
Mahesh DMahesh D
Hi Ravi,

Please use the below formula
 
IF(ISPICKVAL(Some__c, 'A'), 0.1, IF(ISPICKVAL(Some__c, 'B'), 0.11, IF(ISPICKVAL(Some__c, 'C'), 0.12, 0.13)))

I also tested the same in my DE environment and it looks good.

If we select Option A:


User-added image


If we select Option B:

User-added image

Please check the below link:

https://help.salesforce.com/HTViewHelpDoc?id=customize_functions_i_z.htm&language=en_US


Please do let me know if it helps you.

Regards,
Mahesh
Dutta SouravDutta Sourav
Hi Ravi,

You can achieve this through Formula Field using CASE Function.
CASE(picklist_api_name, 
"Picklist Value 1","/10%", 
"Picklist Value 2","11%", 
"Picklist Value 3","12%", 
"else_result_or_default_value"
)
Hope this helps!

Warm Regards,
Sourav.
Dmitry OfitserovDmitry Ofitserov
Hi,
Try using the CASE function on your pick-list field.
This link shows a syntax of the formula : https://help.salesforce.com/apex/HTViewHelpDoc?id=customize_functions_a_h.htm&language=en_US#CASE

You will need to catch a text value of your pick-list, so your formula should look like this:
CASE(TEXT(Some__c),value1, result1,value2,result2,.................,else_result).

Please let me know if it helps.
Amit Chaudhary 8Amit Chaudhary 8
Hi Ravi,

Best way to do this use Case function that is easy to maintain. Try below code
CASE(Text(Country_Field__c), 
"USA",10, 
"Canada",20, 
0 
)
Please change API name according to your org.

Let us know if this will help you

Thanks
Amit Chaudhary
 
Ravi kumar 292Ravi kumar 292
Hi Mohan, Your Formula is working. But is it possible to take the two percentage values for one Picklost value? For example, for Picklist value "A" can i take two percentages 10 % and 11% at a time??
Parker EdelmannParker Edelmann
Hi Ravi,

While formulas only return one value for each record, you can do this:
CASE(Some_Picklist__c,
"A", IF( (Another_condition) = true, 10%, 11%),
"B", 11%,
"C", 12%,
__%)
Using that format you can have value "A" return more than one value, but still only one value at a time.

Hope this helps,

Parker
cloudJoncloudJon

You could create a dependent picklist, and set it to "required". It would only be required if the first one had a value, and would update automatically.

Updating "First" changes "Second" automatically:

Dependent Picklist

This is more scalable than a formula, and easier to administer.