# Portal 2 - Make a permanent row in the bottom of a table?

**URL:** <https://forum.novacura.com/t/portal-2-make-a-permanent-row-in-the-bottom-of-a-table/960>\
**Category:** Flow Classic\
**Tags:** portal\
**Created:** [June 4, 2025, 7:36am UTC](https://forum.novacura.com/t/portal-2-make-a-permanent-row-in-the-bottom-of-a-table/960 "2025-06-04T07:36:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikolo01](https://avatars.discourse-cdn.com/v4/letter/v/7C9FD7/32.png) [@vikolo01](https://forum.novacura.com/u/vikolo01)\
**Post date:** [June 4, 2025, 7:36am UTC](https://forum.novacura.com/t/portal-2-make-a-permanent-row-in-the-bottom-of-a-table/960/1 "2025-06-04T07:36:02Z")

</div>

Hi,  
I’m working on a SQL query that returns multiple rows, and I want to add a final row that shows the total (e.g., sum of a column). I can do this using `UNION ALL`, but the problem is that when I sort the result (e.g., by a column in a UI or tool), the summary row moves around.

Is there a way to make the summary row **always stay at the bottom** , regardless of how the user sorts the other columns?

I want my “Totalbelopp” to always stay in the bottom? Is this possible?

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/1fcdff7bb77397fb22418488fbb53b6416691714.png)

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![ivstde](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/ivstde/32/146_2.png) [@ivstde](https://forum.novacura.com/u/ivstde)\
**Post date:** [June 4, 2025, 9:30am UTC](https://forum.novacura.com/t/portal-2-make-a-permanent-row-in-the-bottom-of-a-table/960/2 "2025-06-04T09:30:04Z")

</div>

Hi,

weeell…back in the day there was this TableOperations connector (it should be now free and included into every license)  
and what we would do in Portal is use Machine workflow with “Datasource with Pagination and Filtering” schema as…well… the datasource 🙂

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/20e895d099271877344fac1cbb22a394b852c13f.png)

Then that would give a whole structure in the start step that needed to be handeled in that TableOperations connector at the end.  
But that also allowed us to put an extra row at the end with Totals and that row would be independant of any sorting

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/6c129a5a1fdd39d57db46fe3888b5e7d271568ff.png)  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/392012e5a6df4d38d80c257bb453560e682db233.png)  
(It wasnt perfect becouse it would show on each page and Sum for the page…but there were ways around that too…like disabling the pagination sometimes 🙂 )  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/20422609bc8a2752605c1627f7cc801622bf7cb1.png)

However, these days this connector is no longer recommended by Novacura as it is suspected to cause performance issues in our Cloud Servers.

Hope this helps!

B R  
Ivan

---

<div class="post-metadata">

**Author:** ![OlaCarlander](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/olacarlander/32/205_2.png) [@OlaCarlander](https://forum.novacura.com/u/OlaCarlander)\
**Post date:** [June 4, 2025, 11:12am UTC](https://forum.novacura.com/t/portal-2-make-a-permanent-row-in-the-bottom-of-a-table/960/3 "2025-06-04T11:12:10Z")

</div>

As Ivan says, do not use the table operator 🙂

> **[Performance Guidelines | Flow Help](https://help.novacuraflow.com/development/performance-guidelines#more-information-on-the-table-operations-connector)**
>
> As a Novacura Flow designer, you are partly responsible for the performance of the applications you create with Novacura Flow. This chapter contains design guidelines that are important to consider.

Maybe the HTML portlet if the table should be read only and non sortable. I did this for a customer yesterday (portal connect, but almost the same) with sums in the headers.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/8d2eaac46986ba632f6ec8b5927a4819aa471949.png)

Or maybe a combo with the table and HTML in a vertical container? Or two tables, but the paginator is a bit ugly in my opinion, for that.

---

<div class="post-metadata">

**Author:** ![OlaCarlander](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/olacarlander/32/205_2.png) [@OlaCarlander](https://forum.novacura.com/u/OlaCarlander)\
**Post date:** [June 4, 2025, 11:44am UTC](https://forum.novacura.com/t/portal-2-make-a-permanent-row-in-the-bottom-of-a-table/960/4 "2025-06-04T11:44:28Z")

</div>

Or..maybe 🤔 if you use a data source with pagination and filtering, without using the table operator. I think you might end up with a non sortable table, and you can control it manually. From our training:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/5ab1281edf3eef49dacef6408162ab6b0606cd8c.png)

---

<div class="post-metadata">

**Author:** ![PvanderHeyden](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/pvanderheyden/32/760_2.png) [@PvanderHeyden](https://forum.novacura.com/u/PvanderHeyden)\
**Post date:** [June 10, 2025, 6:44am UTC](https://forum.novacura.com/t/portal-2-make-a-permanent-row-in-the-bottom-of-a-table/960/5 "2025-06-10T06:44:18Z")

</div>

If you don’t want a distinct layout in your summary you can do it with SQL.  
You have to order on data vs. summary first. Something like this:

```auto
    with d as ( -- data
  select 'A' as C1
       , 3 as C2
    from dual
   union all
  select 'C'
       , 5
    from dual
       ) -- with
  select 'total' as C1
       , sum(d.C2)
       , 3 as SORTING
    from d
   union all
  select d.*
       , 2 as SORTING
    from d
order by SORTING
       , C1

```
