# \[Solved\] Display Sum (total) of a Airtable column in a label

**URL:** <https://community.thunkable.com/t/solved-display-sum-total-of-a-airtable-column-in-a-label/104640>\
**Category:** Questions about Thunkable X\
**Tags:** solved, math, airtable\
**Created:** [June 13, 2019, 1:39pm UTC](https://community.thunkable.com/t/solved-display-sum-total-of-a-airtable-column-in-a-label/104640 "2019-06-13T13:39:16Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![kartik\_old](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik_old/32/28305_2.png) [@kartik\_old](https://community.thunkable.com/u/kartik_old)\
**Post date:** [June 13, 2019, 1:39pm UTC](https://community.thunkable.com/t/solved-display-sum-total-of-a-airtable-column-in-a-label/104640/1 "2019-06-13T13:39:16Z")

</div>

Hello,  
I want to display the total of a column from Airtable. Named **Fees** … And length of the same Column in another label…  
How should I do this?

Thanks😉

---

<div class="post-metadata">

**Author:** ![jane](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jane/32/27575_2.png) [@jane](https://community.thunkable.com/u/jane)\
**Post date:** [June 13, 2019, 3:01pm UTC](https://community.thunkable.com/t/solved-display-sum-total-of-a-airtable-column-in-a-label/104640/2 "2019-06-13T15:01:34Z")

</div>

Hi there,

You can get the Column from Airtable and save it as a list ([example from docs](https://docs.thunkable.com/spreadsheet#getting-items-for-a-listview-from-an-airtable-column)). For this let’s say you saved it as a variable called thisList, and that your total is called thisTotal.

To get the total, you want blocks that say  
set thisTotal to 0  
For each item j in list thisList,  
thisTotal = thisTotal + j

Then display thisTotal on a Label.

Is there a chance that the column you get from Airtable will have blank cells in it?

Thanks,  
Jane

---

<div class="post-metadata">

**Author:** ![kartik\_old](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik_old/32/28305_2.png) [@kartik\_old](https://community.thunkable.com/u/kartik_old)\
**Post date:** [June 13, 2019, 4:23pm UTC](https://community.thunkable.com/t/solved-display-sum-total-of-a-airtable-column-in-a-label/104640/3 "2019-06-13T16:23:33Z")

</div>

@jane, Thanks for your Reply 😄

> [@jane](#):
>
> To get the total, you want blocks that say  
> set thisTotal to 0  
> For each item j in list thisList,  
> thisTotal = thisTotal + j

I didn’t get this code… What’s this code for? (total of list or sum of list?)

> [@jane](#):
>
> Is there a chance that the column you get from Airtable will have blank cells in it?

No. The column is named : **Fees**

Thanks 😄

---

<div class="post-metadata">

**Author:** ![jane](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jane/32/27575_2.png) [@jane](https://community.thunkable.com/u/jane)\
**Post date:** [June 13, 2019, 4:34pm UTC](https://community.thunkable.com/t/solved-display-sum-total-of-a-airtable-column-in-a-label/104640/4 "2019-06-13T16:34:02Z")

</div>

The first block is to get the sum of the list.  
You can find the ‘for each item in list’ block in the ‘Control’ drawer of blocks.

If none of the cells will be empty, then you can use the ‘length of list’ block from the List drawer of blocks to get the length of the list. 😁

---

<div class="post-metadata">

**Author:** ![kartik\_old](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik_old/32/28305_2.png) [@kartik\_old](https://community.thunkable.com/u/kartik_old)\
**Post date:** [June 13, 2019, 4:39pm UTC](https://community.thunkable.com/t/solved-display-sum-total-of-a-airtable-column-in-a-label/104640/5 "2019-06-13T16:39:06Z")

</div>

Thanks 😉

---

<div class="post-metadata">

**Author:** ![sree89chithra](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@sree89chithra](https://community.thunkable.com/u/sree89chithra)\
**Post date:** [June 15, 2021, 12:05pm UTC](https://community.thunkable.com/t/solved-display-sum-total-of-a-airtable-column-in-a-label/104640/6 "2021-06-15T12:05:07Z")

</div>

Hi,  
I tried this code, but not working for me… I want to ADD the values of a column “Today’s Expenditure” and I need to put the sum as the value of another column “Monthwise”. But it is not properly calculating the sum.  
After doing this I also need to delete all values from “Today’s Expenditure”, till that date.  
Sharing my current code here, request you to help me find the error.

 ![Screenshot 2021-06-15 at 5.29.12 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/c/fcd0faede2419ce95caaac826f3b2aeb618024a6.png)

---

<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:** [June 15, 2021, 1:28pm UTC](https://community.thunkable.com/t/solved-display-sum-total-of-a-airtable-column-in-a-label/104640/7 "2021-06-15T13:28:35Z")

</div>

You are using the `in list block where is not required. Just use “j”.

Set app variable SUM to app variable SUM + j

**[Edit]**  
Please next time avoid using old posts. This one is 2 years old already

---

<div class="post-metadata">

**Author:** ![sree89chithra](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@sree89chithra](https://community.thunkable.com/u/sree89chithra)\
**Post date:** [June 16, 2021, 8:44am UTC](https://community.thunkable.com/t/solved-display-sum-total-of-a-airtable-column-in-a-label/104640/8 "2021-06-16T08:44:15Z")

</div>

I tried using j, it didn’t work so i tried using in list block…

Sorry, I will avoid using old threads.

---

<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:** [June 16, 2021, 10:07am UTC](https://community.thunkable.com/t/solved-display-sum-total-of-a-airtable-column-in-a-label/104640/9 "2021-06-16T10:07:28Z")

</div>

I’m sure it works but you need to move the `create row` block inside the `then do` block to avoid getting 0 in the **SUM** variable.

---

<div class="post-metadata">

**Author:** ![sree89chithra](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@sree89chithra](https://community.thunkable.com/u/sree89chithra)\
**Post date:** [June 16, 2021, 11:05am UTC](https://community.thunkable.com/t/solved-display-sum-total-of-a-airtable-column-in-a-label/104640/10 "2021-06-16T11:05:21Z")

</div>

I did the mentioned changes, but when i keep it inside then-do, I get NaN as SUM in Monthwise column and if i keep it outside then-do I get 0 as SUM.  
I even tried keeping CREATE-ROW inside ELSE, still it is NaN.

 ![Screenshot 2021-06-16 at 4.40.08 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/1/c174b25adc508841a4c68472cda97ab0adb4cca3.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:** [June 16, 2021, 11:29am UTC](https://community.thunkable.com/t/solved-display-sum-total-of-a-airtable-column-in-a-label/104640/11 "2021-06-16T11:29:03Z")

</div>

in this last screen, try to put  
 ![01](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/0/f0d17013ec6dab0e3198a05a128bfdd6854731db.jpeg)  
between “for each… do” and “call Airtable …”  
I had this kind of problem working with “for each…”

---

<div class="post-metadata">

**Author:** ![sree89chithra](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@sree89chithra](https://community.thunkable.com/u/sree89chithra)\
**Post date:** [June 16, 2021, 11:36am UTC](https://community.thunkable.com/t/solved-display-sum-total-of-a-airtable-column-in-a-label/104640/12 "2021-06-16T11:36:56Z")

</div>

Thank you  
I gave WAIT still i am getting NaN as the value… should I convert any value anywhere to any other form.

---

<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:** [June 16, 2021, 11:40am UTC](https://community.thunkable.com/t/solved-display-sum-total-of-a-airtable-column-in-a-label/104640/13 "2021-06-16T11:40:49Z")

</div>

if your values are text, you need to convert to number…  
for that, you need to add 0 to any of those values

like: x=x+0 (zero as number in math`s block)

---

<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:** [June 16, 2021, 12:01pm UTC](https://community.thunkable.com/t/solved-display-sum-total-of-a-airtable-column-in-a-label/104640/14 "2021-06-16T12:01:22Z")

</div>

NaN means you are trying to add letters to numbers.

Check the content of “j” by displaying it in a label or something to see where you have characters instead of numbers.

---

<div class="post-metadata">

**Author:** ![sree89chithra](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@sree89chithra](https://community.thunkable.com/u/sree89chithra)\
**Post date:** [June 16, 2021, 12:03pm UTC](https://community.thunkable.com/t/solved-display-sum-total-of-a-airtable-column-in-a-label/104640/15 "2021-06-16T12:03:52Z")

</div>

Hey, Thank you so much actually the WAIT is working now…

---

<div class="post-metadata">

**Author:** ![sree89chithra](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@sree89chithra](https://community.thunkable.com/u/sree89chithra)\
**Post date:** [June 16, 2021, 12:05pm UTC](https://community.thunkable.com/t/solved-display-sum-total-of-a-airtable-column-in-a-label/104640/16 "2021-06-16T12:05:34Z")

</div>

Yes I tried to display j, but it was not displaying as a number, instead something else like [object object etc,  
How can i fix it? as j is a for loop variable

Also how can I delete all previous Airtable rows periodically through Thunkable. DELETEROW deletes only a particular ROW

---

<div class="post-metadata">

**Author:** ![sree89chithra](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@sree89chithra](https://community.thunkable.com/u/sree89chithra)\
**Post date:** [June 16, 2021, 1:39pm UTC](https://community.thunkable.com/t/solved-display-sum-total-of-a-airtable-column-in-a-label/104640/17 "2021-06-16T13:39:06Z")

</div>

Thank you so much @muneer @mimostel for the tremendous support. With your help I have solved my weeks old issue… Finally its a success…

 ![Screenshot 2021-06-16 at 7.07.37 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/1/61b6c8f2b6248c1a6436fd2e9575263d77283e1b.png)

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 12:13pm UTC](https://community.thunkable.com/t/solved-display-sum-total-of-a-airtable-column-in-a-label/104640/18 "2024-11-08T12:13:27Z")

</div>


