How to force zero to display if no sum() value

Posted on 2008-11-13
Last Modified: 2012-08-13
I have a few calculation fields that are sum(amount) through some dynamic self-relationships. I am trying to get zero to display if there are no records through the relationship. I tried:

If ( (Sum (table::amount)) =/= "" ; Sum (table::amount) ; 0 )

but it did not work. How would I create a field calculation to sum through a relationship and display zero if there are no records through the relationship?
Question by:Eroots
    LVL 9

    Accepted Solution

    Try this

    if (IsEmpty(sum(table::field)).0.sum(table::field))
    LVL 28

    Expert Comment

    yes funny, fm is able to force hidding 0's, but not the other way around.
    I would suggest:
    If(Sum(lines::qty) > 0 ; Sum(lines::qty) ; 0)
    just because I don't like to test numeric fields for emptyness, but no difference expected.

    Author Closing Comment

    I was able to get this to work right off the bat. Did not even think about using the IsEmpty function. I took a look at lesouf's suggestion, but had previously tried that and was unable to get it to work. The problem being for summaries that have no values through the relationship, there is no numerical result, it just resolves as "", jvaldes's suggestion seems to be more geared towards the type of work / relationships I am using. THanks all!

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    A lot of new and distinct gadgets are making their appearance every other day. The latest gadget that has wooed the attention of all gadget lovers and non gadget lovers alike is the Smartwatch. This tiny gadget is capable of offering live access to …
    There is a security feature on iOS devices that is nearly impenetrable when it has been activated.  This article will provide some possible solutions as well as necessary steps to take to ensure you do not end up with a locked device.
    Users will learn how resize a batch of photos from a single command in Photoshop via Photoshop's Image Processor. Open up an Image you'd like to resize in Adobe Photoshop: Adjust the image size according to your preferences. Image > Adjustments > …
    Users will learn how to set proper sequence settings, scale images, paste attributes, add transitions, fades, and music. Open up Final Cut Pro 7 and Create a new Project: Set the Sequence Settings. a) Click File > Easy Setup > Format > Apple ProRe…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now