Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Why do calculated fields not work if one factor has a 0 value?

Posted on by

I have a calculated field that does this:

A = B - (C+D)

All of the fields being used are USD currency.   If C or D have a $0.00 balance, the calculated field shows nothing.  Once I put > 0.00 in the field, then the calculation works.  Why is this?

*This post is locked for comments

  • Cyclefitness Profile Picture
    Cyclefitness on at
    RE: Why do calculated fields not work if one factor has a 0 value?

    Thanks, Guido.  Since I don't know JS, I guess I'll have to resort to updating that AVAILABLBE amount via workflows.

  • Cyclefitness Profile Picture
    Cyclefitness on at
    RE: Why do calculated fields not work if one factor has a 0 value?

    Guido ... also in the second example I just don't understand why there is no value in AVAILABLE?  It, too, should be displaying a negative number.

  • Cyclefitness Profile Picture
    Cyclefitness on at
    RE: Why do calculated fields not work if one factor has a 0 value?

    Hi Guido!  

    I'm unfamiliar with the | in your syntax.  Is that something to literally add to the equation?

    Oh, and if I only knew JS to be able to do that. ;-)  And if JS was implemented, then the values would only update on form load, correct?  Doesn't a calculated field also update if a report is run against it?

  • Cyclefitness Profile Picture
    Cyclefitness on at
    RE: Why do calculated fields not work if one factor has a 0 value?

    Thanks for the info, Teddy.  I've read through everything and don't find anything that explains the inconsistent behavior.  

  • Suggested answer
    Teddyable Profile Picture
    Teddyable 155 on at
    RE: Why do calculated fields not work if one factor has a 0 value?

    Calculated field can be very annoying, if you miss a minor detail.

    but sometimes it pays to go back to basics, have a look at this links, it helped me when i had a similar headache

    msdn.microsoft.com/.../dn817863.aspx

    www.preact.co.uk/.../working-with-calculated-fields-in-microsoft-dynamics-crm

    www.youtube.com/watch

    hope it sort of helps

  • Cyclefitness Profile Picture
    Cyclefitness on at
    RE: Why do calculated fields not work if one factor has a 0 value?

    And then this screenshot is another record on the same entity.  WHAT GIVES here???

    2350.1.png

  • Cyclefitness Profile Picture
    Cyclefitness on at
    RE: Why do calculated fields not work if one factor has a 0 value?

    But then if you look at this group of numbers -- on the same form -- this AVAILABLE amt is correct.  It's processing the negative correctly.  AVAILABLE = (Payments $ + Encumbered $)

    :66760.1.png

    Same formula as in the previous post:

    66760.1.png

    It's late and I'm tired, but I don't think I'm really that bad at math.

  • Cyclefitness Profile Picture
    Cyclefitness on at
    RE: Why do calculated fields not work if one factor has a 0 value?

    Here's what I have:

    836256.1.png

    AVAILABLE = Start $ - (Payments $ + Encumbered $).

    I'm figuring that result should be $1,311.  It's adding the Total Payment negative amount rather than subtracting.  This is some crazy math thing, I'm sure.  ;-)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans