# Calculating Average Rating from Child Records in Linked Tables

**URL:** <https://community.glideapps.com/t/calculating-average-rating-from-child-records-in-linked-tables/69872>\
**Category:** Ask for Help\
**Tags:** custom-code\
**Created:** [January 22, 2024, 10:52pm UTC](https://community.glideapps.com/t/calculating-average-rating-from-child-records-in-linked-tables/69872 "2024-01-22T22:52:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikec](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mikec/32/53291_2.png) [@mikec](https://community.glideapps.com/u/mikec)\
**Post date:** [January 22, 2024, 10:52pm UTC](https://community.glideapps.com/t/calculating-average-rating-from-child-records-in-linked-tables/69872/1 "2024-01-22T22:52:22Z")

</div>

Hey folks,

I’m facing a simple challenge with two linked tables. Table1 serves as the parent record, and Table2 holds the child records. My goal is to display the average rating from Table2 onto Table1.

Within each Table2 record, there are 6 distinct numeric ratings. I’m looking for a solution to calculate the overall average rating across these six values, enabling me to roll up and present it on Table1.

Any suggestions or solutions would be greatly appreciated. Thanks a bunch!

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [January 22, 2024, 11:38pm UTC](https://community.glideapps.com/t/calculating-average-rating-from-child-records-in-linked-tables/69872/2 "2024-01-22T23:38:09Z")

</div>

> [@mikec](#):
>
> Within each Table2 record, there are 6 distinct numeric ratings.

Are those always not empty? To cover the case that it can be empty somewhere, I would suggest:

- Create a Make Array column and add all rating columns in there.
- Create a rollup column, choose the Make Array column as the source and choose “average”.
- In Table1, use an average rollup again, pointing to the rollup column in step 2.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/9/d981b03f2243981ae1df51101c7e2e5d4021760c.png)

---

<div class="post-metadata">

**Author:** ![mikec](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mikec/32/53291_2.png) [@mikec](https://community.glideapps.com/u/mikec)\
**Post date:** [January 23, 2024, 12:11am UTC](https://community.glideapps.com/t/calculating-average-rating-from-child-records-in-linked-tables/69872/3 "2024-01-23T00:11:46Z")

</div>

Brilliant, the good old “Make Array”. Thanks @ThinhDinh !

---

<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:** [January 30, 2024, 12:12am UTC](https://community.glideapps.com/t/calculating-average-rating-from-child-records-in-linked-tables/69872/4 "2024-01-30T00:12:18Z")

</div>

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