Bug: Empty SUM query returns empty (instead of 0)


I’ve noticed that an empty COUNT query returns a 0 where an empty SUM returns “” (an empty string).

Is it possible to quickly fix this so an empty SUM query also returns a 0?


Hi @arthurrjw,

That’s interesting - you’re right. Same with Average (and I presume with Min/Max etc).
From some point, it seems logical - if the collection is empty, why would Sum be equal 0? it also should be empty…

May be you can explain what roadblock are you hitting? The problem might have another solution.

Best regrads,

Sure! I’m building an emotion tracking app (https://moments.theartofliving.com)

When you check in, you pick an emotion and you pick an intensity.

The intensities are quantified where “a little” = 1, “quite” = 2 and “very” = 3

On the history screen, the app shows a breakdown of two things:

  1. The number of times you checked in with an emotion (count filtered by emotion); and
  2. The overall intensity of the emotional checkins each day (sum of intensty scores by emotion)

The problem is that right now, I get a blank in the intensity (sum) boxes where no check-ins have been registered (see screenshot).

Screenshot 2020-11-09 at 05.58.39|337x499

The only workaround I can think of is to use a “sometimes visible” label with a “0” in it that displays when the sum returns empty (or hide the counts when they’re “0”) to make the display consistent.

But if there’s a way to force a zero out of a sum when the sum is zero (as you would see in excel or google sheets) that would be easier/better!

Thanks for your help, Victor!!

Hi @arthurrjw,

I’m assuming you have a Label with Magic Text inside?
Try to use Custom Formula as a workaround (down in the options menu -> Formulas), and then use Sum of emotions (with all filters needed).
Please let me know if this helps.


1 Like

Thanks @Victor - this workaround worked perfectly!

Thank you for your help.

1 Like

Hi @arthurrjw,

My pleasure :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.