Moving average in Coda
Comparing dates and using filters
In my blog about preceding values I argued why in Coda we do not have the concept of previous row, but we work with preceding values. That is the concept we apply as well in the presented solution.
It all has to do with the concepts of rows and how they are related in a table. There is always a sorting active, even when you did not sort the table actively. We call this the initial sorting and more about it in this blog.
Building blocks in a moving average
We need dates and numeric values we can manipulate to get the average. As you know, dates are numbers as well and this makes the application of a filter the easiest choice.
Below we applied a filter to compare dates and in the display column you see how many dates and related numbers we count. We start with one and each row adds one number.
The second step is to get only the last 6 numbers and so we slice the the range using Slice(-6)
Last but not least, we take the average and that is it.
More details in this doc:
My name is Christiaan and blog about Coda. Since the summer of 2023 mainly about how to Coda with AI to support organisations dealing with texts and templates. The latest Coda AI update was on Dec 7, 2023.
Why I focus on Coda AI you can read here: ⤵️
I hope you enjoyed this article. If you have questions feel free to reach out. Though this article is for free, my work (including advice) won’t be, but there is always room for a chat to see what can be done. You find my (for free) contributions to the Coda Community and on Twitter.
Coda comes with a set of building blocks ー like pages for infinite depth, tables that talk to each other, and buttons that take action inside or outside your doc ーso anyone can make a doc as powerful as an app (source).
Not to forget: the Coda Community provides great insights for free once you add a sample doc.