1

I have been asked to create a field on Opportunity that will show the value of the Amount field but taking into account the Probaility value. So, if the Amount field was GBP 100,000 and the Probability field was 80%, then this new field would show GBP 80,000.

However this does not seem to be possible in a formula field (I naively thought this would be simple). When attempting to perform any maths on the Amount field all that is returned is 0.

I can see why, the currency field is not a number, it includes the string of the currency being used, formatting and exchange rates, so doing maths on this is not as simple as it first seems. But surely this requirement cannot be that uncommon, it must be possible... right?

Any help greatly appreciated. I can't face telling the sales director I can't do maths on currencies :/

We are using managed currencies if that affects the answers. My code so far is as so:

(Total_Value_Retail__c + Total_Value_Rental__c) * (Value(Text(Probability)) / 100)

Thanks Jamie

2 Answers 2

3

The Probability field is a Percentage type, so you can just multiply it without the /100 or even the Value(Text()) part. So what you need is:

(Total_Value_Retail__c + Total_Value_Rental__c) * Probability
2
  • I am so sorry, I have been very silly here and as my punishment I shall explain my stupidity. Turns out the random Opportunity I had chosen to test this on... it had a probability of 0%... I shall go home now, enjoy my weekend and forget this ever happened. Thank you for your help, by insisting this was as easy as it seemed you forced me to see the sense. Also I hadn't realised I had i posted the code with the Value(Text( conversions... that was part of a desperate attempt to get this working. Thanks for your help.
    – Jammerz858
    Nov 6, 2015 at 16:54
  • @Jammerz858 - To end your punishment please accept an answer so the question gets closed. Otherwise, it will randomly appear in the list as unanswered bringing up your 'silliness' all over again at random times int he future
    – Eric
    Nov 6, 2015 at 22:30
1

I did an experiment and it seems fairly simple.

Create a currency field, a percent field and a formula field that returns currency.

I called these Total_Value__c, Probability__c and Probable_Value__c.

Set the formula for Probable_Value__c to Total_Value__c * Probability__c

Remember that percentages are entered as numbers between 1 - 100. So I enter 50 for 50%.

I didn't enable managed currencies to test this. Not sure if it would make a difference.

1
  • 1
    I am so sorry, I have been very silly here and as my punishment I shall explain my stupidity. Turns out the random Opportunity I had chosen to test this on... it had a probability of 0%... I shall go home now, enjoy my weekend and forget this ever happened. Thank you for your help, by insisting this was as easy as it seemed you forced me to see the sense.
    – Jammerz858
    Nov 6, 2015 at 16:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .