# Workaround for rollup on computed column in PostgreSQL

**URL:** <https://community.glideapps.com/t/workaround-for-rollup-on-computed-column-in-postgresql/70440>\
**Category:** Ask for Help\
**Created:** [February 2, 2024, 10:20pm UTC](https://community.glideapps.com/t/workaround-for-rollup-on-computed-column-in-postgresql/70440 "2024-02-02T22:20:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aferguson024](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@aferguson024](https://community.glideapps.com/u/aferguson024)\
**Post date:** [February 2, 2024, 10:20pm UTC](https://community.glideapps.com/t/workaround-for-rollup-on-computed-column-in-postgresql/70440/1 "2024-02-02T22:20:21Z")

</div>

Hello

I have a postgresql data source.

I have an invoicing system with a parent record (the invoice) and child records (the line items). The line items include a quantity, unit price and a total price, which is a function of quantity \* unit price.

I need to sum up the ‘total price’ for each line item at the parent level.

What is the best workaround for this? Is there a way in Postgresql to create a total\_price column in the child item that performs the maths I want, then presumably I can roll this up in Glide as it is not a computed column?

Or do I need something more complicated at the parent level in Postgresql (and if so, I have no idea where to start!).

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [February 2, 2024, 10:28pm UTC](https://community.glideapps.com/t/workaround-for-rollup-on-computed-column-in-postgresql/70440/2 "2024-02-02T22:28:05Z")

</div>

> [@Advanced multi-filters with SQL as a data sources](https://community.glideapps.com/t/advanced-multi-filters-with-sql-as-a-data-sources/68695/2):
>
> Hi, Eden! This is a video made from @DarrenHumphries. It’s a workaround that may help you

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [February 9, 2024, 10:28pm UTC](https://community.glideapps.com/t/workaround-for-rollup-on-computed-column-in-postgresql/70440/3 "2024-02-09T22:28:51Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
