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

Hey!

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?

Thanks!

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.

Victor

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!

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.

Best,
Victor

1 Like

Thanks @Victor - this workaround worked perfectly!