Group by summing up jumps empty items

I have a list of items of different types , numbered from 0 to 4. and I want to sum the m up and group them.
After that I will use it on a repeating group where I need the sums including those which are 0 (without having items of that type).

Do a search for points group by (type) ’ sum of values

The problem is that when I don’t have any item of that type, it jumps the sum and doesn’t return the 0 that I intend to have on the list.

Instead of having this:
0, 5, 0, 7, 3

I have this:
5, 7, 3

So in the repeating group, it will not display all the types …

I tried to add up +0 and it works if I do it individually, but I cannot use this method on a list after I use group by.

Is there anything I can try to make this work out?

This can be tricky to get right, and has been asked a few times, so here is a demo …

app editor
app runtime

Kind of large picture ...

How it works:

a) Make a list of your possible types, using “List of numbers” in the Toolbox, use this list as the RG source, then refer to the search list grouping result (can be in another RG, a custom state, or using the “search”, and filter by the current cell’s type (which is a number).

Alternatively, you may find your data structure works better with the type in a separate “thing”, I’ve shown this as “Category” …

b) Search a list of Category as the RG source, and on each cell, refer to the group by result, filter by the current cell’s category. No need for a separate list of numbers for this.

In both cases, the filter returns a list (of one grouping), so pick the first item, then to make the blank numbers into zeroes, add zero.

1 Like

thank you a lot!

This topic was automatically closed after 70 days. New replies are no longer allowed.