# Get an average of scores from Airtable

**URL:** <https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500>\
**Category:** Questions about Thunkable X\
**Tags:** beginner\
**Created:** [November 3, 2021, 1:22pm UTC](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500 "2021-11-03T13:22:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![brunospavei2kqs](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@brunospavei2kqs](https://community.thunkable.com/u/brunospavei2kqs)\
**Post date:** [November 3, 2021, 1:22pm UTC](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500/1 "2021-11-03T13:22:01Z")

</div>

Hello everyone.

I need the average of the last column, but the average is for the same LOCAL, same DATE and same TURN.  
For each of this 3 points I want an average.  
Tks!!

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/9/1914b7b89af4efeb2dce6d8077e0b6366d173ee9.png)

I

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [November 3, 2021, 2:21pm UTC](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500/2 "2021-11-03T14:21:34Z")

</div>

You can use an average formula in Airtable or use the math blocks in Thunkable.

I don’t understand what you mean by “is for the same \_\_\_\_\_.” Can you give an example? How would you find the average for one row if you weren’t using Thunkable?

---

<div class="post-metadata">

**Author:** ![brunospavei2kqs](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@brunospavei2kqs](https://community.thunkable.com/u/brunospavei2kqs)\
**Post date:** [November 3, 2021, 2:30pm UTC](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500/3 "2021-11-03T14:30:37Z")

</div>

Is a surf app. The surfer will rating a surf day.  
Imagine that I surf in “A” beach (LOCAL), yesterday (DATE), in the morning (TURNO (am/pm)) and I rate the surf/waves with a 8 score.  
You surf on the same LOCAL, DATE and TURNO and give a 6 score.  
Then, for the same LOCAL, DATE and TURNO the score average is 7.  
If you surf today this score don’t enter on average of yesterday, it’s another average.  
This is the order of importance:

— LOCAL  
— DATE  
— TURNO  
— NOTA (score)

---

<div class="post-metadata">

**Author:** ![brunospavei2kqs](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@brunospavei2kqs](https://community.thunkable.com/u/brunospavei2kqs)\
**Post date:** [November 3, 2021, 2:31pm UTC](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500/4 "2021-11-03T14:31:12Z")

</div>

— LOCAL  
—------- DATE  
—-----------------TURNO  
—-------------------------- NOTA (score)

---

<div class="post-metadata">

**Author:** ![brunospavei2kqs](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@brunospavei2kqs](https://community.thunkable.com/u/brunospavei2kqs)\
**Post date:** [November 3, 2021, 2:35pm UTC](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500/5 "2021-11-03T14:35:19Z")

</div>

Im using Thunkable.  
This data is from Thunkable.  
The people rating there, and the data (ID, LOCAL, DATE, TURN, SCROE) goes to Airtable, like the table that I posted.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [November 3, 2021, 3:01pm UTC](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500/6 "2021-11-03T15:01:17Z")

</div>

Okay, I understand now. You can either loop through the dates in Thunkable and sum the scores for each date that is the same or you can use a [custom view/filter](https://support.airtable.com/hc/en-us/articles/360003695134-Guide-to-filtering-records-using-conditions) in Airtable to retrieve only the scores for a specific day. I think I might try to do all of this in Airtable and have the spreadsheet calculate the averages for each day. And then pull the values into Thunkable.

The main problem with that approach is that you can’t use a variable to dynamically reference an Airtable view. So I’m not sure how to connect each new day with Thunkable. Maybe it all has to happen in a single view. Probably.

---

<div class="post-metadata">

**Author:** ![brunospavei2kqs](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@brunospavei2kqs](https://community.thunkable.com/u/brunospavei2kqs)\
**Post date:** [November 3, 2021, 4:36pm UTC](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500/7 "2021-11-03T16:36:37Z")

</div>

But I need to use this dynamically. For each place will have a different average. I will use it to TRY to predict the next wave score.  
I want to compare the average with some surf forecast data (windy, swell…).  
Of course that I don’t know if its possible.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [November 3, 2021, 4:57pm UTC](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500/8 "2021-11-03T16:57:38Z")

</div>

It sounds like you need to figure out the algorithm for all of these averages and predictions. Or maybe you already know it. But you’ll need to explain it in lots of detail so that someone here can help you figure out the blocks you will need in Thunkable.

---

<div class="post-metadata">

**Author:** ![mimostel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mimostel/32/107661_2.png) [@mimostel](https://community.thunkable.com/u/mimostel)\
**Post date:** [November 3, 2021, 6:15pm UTC](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500/9 "2021-11-03T18:15:23Z")

</div>

First of all, you need another column in your table to keep that **average** NOTE.  
You just can’t replace NOTE with average, as a user can further give a NOTE and average will be re-calculate after that.  
This being said, lets think further.  
I think about this algorithm this way: **average** will be given by **sum** of all **notes** of records that matches condition / number of those records.  
So you need to loop through all record, check if matches condition, sum the notes and divide to its number.

 ![001](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/8/2886fa16d6ff91164b8f7045e8f2e7880cfd81de.png)

 ![002](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/4/f4c75d7eaa987f31bedeca54ef4403ebdc3e4b5c.png)

 ![003](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/5/558ce0e38358038afd7d93394ec7016cf0cdda10.png)

 ![004](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/2/526c2e4ec0e9d57d8325fdc8df1b4af8d39200f1.png)

It might be some further speed or optimized improvements for this, I just want it to give you some fast guidance on how to think for your problem.

**Notice** This is for a local table. As I don’t use Airtable i don’t know if there is some automation that will help you skip some of steps from here.

---

<div class="post-metadata">

**Author:** ![brunospavei2kqs](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@brunospavei2kqs](https://community.thunkable.com/u/brunospavei2kqs)\
**Post date:** [November 3, 2021, 8:31pm UTC](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500/10 "2021-11-03T20:31:44Z")

</div>

Tks!!  
But… How I find this blocks:

- number of rows in…
- update value in…

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/c/4cbfe29605cc7209665dc7a8ecb07aeddc8f747a.png)

---

<div class="post-metadata">

**Author:** ![mimostel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mimostel/32/107661_2.png) [@mimostel](https://community.thunkable.com/u/mimostel)\
**Post date:** [November 3, 2021, 8:49pm UTC](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500/11 "2021-11-03T20:49:05Z")

</div>

If you add as **data source** your Airtable table,

 ![001](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/f/af2ce8af6faa30e50e204b039f984553bbfccf69.png)  
you will get as blocks those:  
 ![002](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/0/c084570ce2eada39b2a5bdc5ad0f7a3c292b9030.png)

---

<div class="post-metadata">

**Author:** ![brunospavei2kqs](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@brunospavei2kqs](https://community.thunkable.com/u/brunospavei2kqs)\
**Post date:** [November 3, 2021, 8:52pm UTC](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500/12 "2021-11-03T20:52:34Z")

</div>

Thanks! Lets do it!

---

<div class="post-metadata">

**Author:** ![mimostel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mimostel/32/107661_2.png) [@mimostel](https://community.thunkable.com/u/mimostel)\
**Post date:** [November 3, 2021, 9:19pm UTC](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500/13 "2021-11-03T21:19:28Z")

</div>

Ok. Let me know if you succeeded 🙂

---

<div class="post-metadata">

**Author:** ![brunospavei2kqs](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@brunospavei2kqs](https://community.thunkable.com/u/brunospavei2kqs)\
**Post date:** [November 4, 2021, 2:04am UTC](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500/14 "2021-11-04T02:04:42Z")

</div>

It’s very hard.  
It’s almost work. I don’t know if the average is right, maybe it’s working just for last 2 scores.  
And the average happen slow, I really don’t know when.

That’s the project: [Thunkable](https://x.thunkable.com/copy/cacc5aecd9b4a778b5de5634a493202b)

I don’t know whats the problem.

---

<div class="post-metadata">

**Author:** ![mimostel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mimostel/32/107661_2.png) [@mimostel](https://community.thunkable.com/u/mimostel)\
**Post date:** [November 4, 2021, 8:54am UTC](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500/15 "2021-11-04T08:54:44Z")

</div>

> [@brunospavei2kqs](#):
>
> It’s almost work. I don’t know if the average is right, maybe it’s working just for last 2 scores.

You may easily manually check. Using average as integer when it comes to pretty same NOTES will round the result. You get much more accurate average value if you will use 2 decimals instead.

> [@brunospavei2kqs](#):
>
> And the average happen slow, I really don’t know when.

See this:  
[Using LocalDB as source of DVL - Thunkable Discuss - Community](https://community.thunkable.com/t/using-localdb-as-source-of-dvl/1589677/4)  
and you will see that I’m complaining about the speed when using local tables too. For Airtable, GoogleSheets is even worst when it comes to do calculations with large data…  
@domhnallohanlon promised me that will provide an answer so I’m confident 😊

Maybe in your case you can implement some trick that @muneer taught us, about making another filtered sheets from original sheets in Airtable, then use that for DVL. This way you can sum directly an entire column from filtered and speed up the app.

---

<div class="post-metadata">

**Author:** ![brunospavei2kqs](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@brunospavei2kqs](https://community.thunkable.com/u/brunospavei2kqs)\
**Post date:** [November 5, 2021, 7:57pm UTC](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500/16 "2021-11-05T19:57:52Z")

</div>

Do you think is possible do the average if I send the data to Firebase?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [November 6, 2021, 7:06am UTC](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500/17 "2021-11-06T07:06:43Z")

</div>

Can you share your Airtable table so I can build the blocks required for the average and test it with the data?

---

<div class="post-metadata">

**Author:** ![brunospavei2kqs](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@brunospavei2kqs](https://community.thunkable.com/u/brunospavei2kqs)\
**Post date:** [November 6, 2021, 6:40pm UTC](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500/18 "2021-11-06T18:40:15Z")

</div>

> **[Airtable | Everyone's app platform](https://airtable.com/invite/l?inviteId=inv7YhqEoW2sZICRy&inviteToken=11bc28d718d1c998dd6d833290f2335fe1adb5cc638f44f6e64458574e3643b9&utm_source=email)**
>
> Airtable is a low-code platform for building collaborative apps. Customize your workflow, collaborate, and achieve ambitious outcomes. Get started for free.

---

<div class="post-metadata">

**Author:** ![shrey](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/shrey/32/105637_2.png) [@shrey](https://community.thunkable.com/u/shrey)\
**Post date:** [November 7, 2021, 2:27pm UTC](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500/19 "2021-11-07T14:27:26Z")

</div>

Example of average formula in thunkable: ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/6/761bf54a2440acb881e5c320b8c0aa2990f121ea.png)  
Variable added\_number has the total of all the values you want to get the average of. Variable numofquest’s value is the number of numbers you previously added.

Another example:  
2 + 8 = 10  
10 / 2 = 5  
In this example, 2 and 8 are the two values I want to get the average of, and 5 is the average number.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [November 7, 2021, 4:36pm UTC](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500/20 "2021-11-07T16:36:30Z")

</div>

Thank you but the issue is about grouping not just averaging

[Next page](https://community.thunkable.com/t/get-an-average-of-scores-from-airtable/1595500.md?page=2)
