• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 518
  • Last Modified:

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

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?
1 Solution
Try this

if (IsEmpty(sum(table::field)).0.sum(table::field))
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.
ErootsAuthor Commented:
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!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now