Aug 07, 2023 02:59 PM
Hello Airtable Community,
I hope all is well! I am having trouble with creating a running total formula/script. In the first table called "General Monthly KPIs" there is a field linking to the "Transactions" table with the dates, month and year, and the amounts of each transaction. There is a rollup field in the General Monthly KPIs table that calculates the monthly burn of each month. How can I create a running total field? There are thousands of transactions, so the 1-to-1 and 1-to-many method will not be applicable.
I tried scripting, here is my script:
Which resulted in an incorrect running total:
Does anyone know how to create a running total?
I hope you all have a great day!
- Ella
Solved! Go to Solution.
Aug 07, 2023 05:38 PM
Hi @triple,
"Month and year" is a string, so if you sort it in ascending order, it will be in ABC order.
You need to sort by date value, or a number such as 20230808
Aug 07, 2023 07:53 PM
Changing the date field to a date field instead of a text field would should fix your script. Alternatively, you could use an auto number field and sort with that instead. Just make sure when you create the field the sort is in the order you want.
Aug 07, 2023 05:38 PM
Hi @triple,
"Month and year" is a string, so if you sort it in ascending order, it will be in ABC order.
You need to sort by date value, or a number such as 20230808
Aug 07, 2023 07:53 PM
Changing the date field to a date field instead of a text field would should fix your script. Alternatively, you could use an auto number field and sort with that instead. Just make sure when you create the field the sort is in the order you want.
Aug 08, 2023 08:14 AM
Thank you so much! It worked perfectly.
Aug 08, 2023 08:15 AM
Thank you!! I added a field called "month last day" and replaced it in the script-- worked perfectly!