# Custom Aggregation Column Name

**URL:** <https://community.velixo.com/t/custom-aggregation-column-name/128>\
**Category:** Q&A\
**Tags:** Sage-Intacct\
**Created:** [December 11, 2025, 12:46am UTC](https://community.velixo.com/t/custom-aggregation-column-name/128 "2025-12-11T00:46:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Perry](https://community.velixo.com/letter_avatar_proxy/v4/letter/b/7ab992/32.png) [@Ben\_Perry](https://community.velixo.com/u/Ben_Perry)\
**Post date:** [December 11, 2025, 12:46am UTC](https://community.velixo.com/t/custom-aggregation-column-name/128/1 "2025-12-11T00:46:57Z")

</div>

Howdy,

I’d love to be able to specify a custom column name when using Aggregate functions.

I’m using TOTABLE with SI.QUERY and when referencing a column in the table it’s something like this:

```auto
MyNamedTable[SUM(AMOUNT)]

```

It would look a little nicer to have something like this instead:

```auto
MyNamedTable[TOTAL]

```

I imagine the syntax could be similar to SQL column aliases:

```auto
SI.QUERY("Sage","GLDETAIL",,"LOCATIONID,DEPARTMENTID,ITEMID,SUM(AMOUNT) As TOTAL")

```

Hopefully that makes sense.

Cheers

Ben

---

<div class="post-metadata">

**Author:** ![Gabriel](https://community.velixo.com/user_avatar/community.velixo.com/gabriel/32/7_2.png) [@Gabriel](https://community.velixo.com/u/Gabriel)\
**Post date:** [December 11, 2025, 2:49pm UTC](https://community.velixo.com/t/custom-aggregation-column-name/128/2 "2025-12-11T14:49:31Z")

</div>

Hi Ben,

The TOTABLE() function is meant to be used with functions that do not support table-mirroring out of the box. With the SI.QUERY function, you can simply use the OutputColumn argument to specify the location of the first column of the table. You are then completely free to rename the column header, and Velixo will be smart enough to remember where the data goes when refreshing.

Here’s a short video demo: [https://www.loom.com/share/4737c79e994b4c53b40797c20f560e26](https://www.loom.com/share/4737c79e994b4c53b40797c20f560e26)

Question: do you have a filter setup on your query? Aggregation happens locally at the moment so the full GLDETAIL will be loaded without any filtering.

P.S. I moved your post to the Sage Intacct area.

[Query with Table Mirroring and Aggregates.xlsx](https://community.velixo.com/uploads/short-url/9vUvr3UgzvyIg5eOv2cSMAH7dTG.xlsx) (20 KB)

---

<div class="post-metadata">

**Author:** ![Gabriel](https://community.velixo.com/user_avatar/community.velixo.com/gabriel/32/7_2.png) [@Gabriel](https://community.velixo.com/u/Gabriel)\
**Post date:** [December 11, 2025, 2:49pm UTC](https://community.velixo.com/t/custom-aggregation-column-name/128/3 "2025-12-11T14:49:55Z")

</div>

I forgot to attach the file I built in the video - here you go!

---

<div class="post-metadata">

**Author:** ![Ben\_Perry](https://community.velixo.com/letter_avatar_proxy/v4/letter/b/7ab992/32.png) [@Ben\_Perry](https://community.velixo.com/u/Ben_Perry)\
**Post date:** [December 15, 2025, 4:52am UTC](https://community.velixo.com/t/custom-aggregation-column-name/128/4 "2025-12-15T04:52:39Z")

</div>

Hi Gabriel,

Thanks for your answer and the Loom video - I didn’t realise table mirroring was so feature rich.

Yes I definitely have a query filter - I was just pasting a shortened version of my formula 🙂

My concern with the ability to rename columns afterwards and it being smart, is that for someone else working on the workbook it’s not obvious how the table column naming is/was done/mapped.

Providing column names within the formula would make it clear either using SQL style aliases, or as a seperate argument.

Alternatively I could turn off table headers within SI.QUERY, and then specify them manually, but not the cleanest approach.

I think I originally went with TOTABLE because the output table shrunk if there were no results and so it would shift cells on the right leftwards. My more complicated formula which after testing won’t be needed. (Note the IFERROR to handle the shrinking table issue I bumped into. And I found I had to specify every output column too to make it more stable)

```auto
=TOTABLE(
    IFERROR(
        SI.QUERY(Connection_Name, "GLDETAIL", TX_FILTER, TX_COLUMNS, TRUE, HSTACK({"Sort"}, {"BOOKID,ITEMID,EMPLOYEEID,LOCATIONID,DEPARTMENTID"})),
        VSTACK({"ITEMID", "EMPLOYEEID", "LOCATIONID", "DEPARTMENTID", "BOOKID", "BASECURR", "SUM(AMOUNT)"})
    ),
    ,
    TRUE,
    $Q$9, $R$9, $S$9, $T$9, $U$9, $V$9, $W$9
)

```

The new formula I’m going with is:

```auto
=SI.QUERY(Connection_Name, "GLDETAIL", TX_FILTER, TX_Columns, TRUE, HSTACK({"Sort"},{"BOOKID,ITEMID,EMPLOYEEID,LOCATIONID,DEPARTMENTID"}), $Q$9, $R$9, $S$9, $T$9, $U$9, $V$9, $W$9)

```

Do you see any issues with that?

Also, currently if there’s no output I get my columns but the formula cell shows #N/A.  
Can that error message be changed to “No results” or is that an excel limitation?

Kind regards

Ben
