Group by in table element

Hi there!

I am having issues with the table element. I have energy consumption data by month in my database. However I need the table to display the data by quarter. I have tried to use the group by function but it does not seem to work.

Is there a way to make the table show me the sum of every 3 month?

Thanks!

Have you tried the group by on a repeating group?

Group by functionality is a bit complex, which expression in the group by functionality are you using?

Your new table data source should be (Your current data source):grouped by month (3 month intervals). Add an aggregation that is field’s sum.

Thank you very much @fuhclifffuhche @georgecollier,

I have tried pretty much everything but the problem is that I need all the columns to be grouped by at the same time since there are several items in the table (from the same database). However, when I change the data source, Bubble says that I cannot have the current data type (the database) but a data type number, which at the same time basically bugs the whole table.



This is the result I have when I do the group by. What I actually need is to group by every 3 rows…

Looks like a table bug because you shouoldn’t be able to change the data source to a different data type (Energy version grouped by is different to Energy version)

Ok but in the last picture I created a new table with a grouping data type and it does not work either

First try with a repeating group. Get an RG. Data source is Search for Energy version 2:grouped by month (interval 3 months). Check ‘do not skip empty groups’. Add an aggregation ‘sum’ for the kWh and cost fields.

In each RG cell, display using text Current cell’s grouping’s sum of kWh and Current cell’s grouping’s sum of cost. This will work. If it doesn’t, you haven’t followed the instructions correctly.

Then, copy and paste the same expression into a new table and add the text fields to the cells. If that doesn’t work, it’s a table issue that you should report to Bubble.

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