Implement Sort with Total row in table from SQL query - Best practices for Total Row in table

I have a table as shown in the screenshot, I have several rows, and I have included the Total row through a UNION in my SQL query.

However, I would also want to implement the sort functionality by clicking on the columns, but in this case, I don't want the position of the Total Row to change, as the Total row must always be at the end.

Is there a better way to add Total Row at the end of the table? We need it as a row in the table, and also want to have the sort functionality work when we click on the columns, ignoring the Total Row position

Hey @achou!

Table summary rows have been requested a number of times before, they aren't on the roadmap at the moment but we can let you know here if they do get included. In the meantime, your best bet might be to have the summary row exist outside of the table as suggested in this thread.

Could that work for you?

Thanks for sharing this detail. I did look at this thread, and considered putting the summary rows outside of the table. However, the approach does not work if the contents of the table (columns) are re-sized and/or re-ordered. If I move the columns around, I did not see a way to move the textual or label data containing the summary as per the changes in the column position.

Is there a way to achieve this?

Hello! Good news - I was wrong :upside_down_face: :tada:

Summary rows have actually recently been added alongside grouped row aggregation options as mentioned in this post. You can find it as an add-on in the new table:

Let me know if that works!

Hi,

Thanks a lot for sharing this. While this is extremely useful, I need the ability to insert custom formulae in the summary rows

For eg, I have a column - Col C - which is defined as the value in Col A divided by the value in Col B
So when I want to add the summary row, I want to have SUM(Col A)/SUM(Col B) so that the right value is reflected.

Is there any plan to have these features in the Summary row? I see this as a fairly common scenario for us, and I think this is going to be a very helpful feature for everyone using the table row

I see, there aren't specific plans for it at the moment but it is something that the dev team is aware of and tracking!