How to Coda a Time Table?
Part 01 — Showing stops, travel times and more
When you set up a a time table in Coda you probably have in mind the structure you see at bus stops or in the underground. It is a list, a vertical structure like above. On top the starting time and at the bottom the end of the line.
Is this the right structure to Coda? Well the alternative is something like below — the columns represent the stops and the rows contain the stop times.
If you want to add a stop in this approach, you create a column and then the column should be positioned correctly. If you want to have the time between two stops, you need an extra column and that for each delta. This makes this approach the wrong set up, you need to many columns and you easily got mistaken. Below the alternative, however Coda tables are not like spreadsheets, so we need to be smart to distract the values we need.
Duration and time between stops
The duration of the trip is the last value minus the first value. This works fine until the the arrival time is after midnight, in this case the arrival time is smaller than the departure time and you need to add 24 hours, see below:
This example has only one trip, so indeed we take the last value of the duration and distract the first value. In a one table one trip approach, this works, but what if we have multiple trips in one table? In that case we add a filter to split between line number 1 and line number 2.
You see I applied a
withName() to generate understandable Coda code.
We finish with two sorts of information you might want to have once you operate lines like these. How does the build up of a working day look like?
As you see I created a RowIndex starting with a zero. This makes the first cell in the RollingTotal empty (you cannot see this on the screenshot). The day takes 10h30 minutes, meaning 11 hours. In an other blog we deal with the driver costs related to this time frame.
Once you want to have the logic for each line (1 & 2) you replace the RowIndex by the GroupIndex and again we start with a zero adding -1 to the function, click here for more info.
In this blog we covered some basics related to working with time tables. These building blocks are required to:
- set up a planning.
- define the budget
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. Besides you find my (for free) contributions to the Coda Community and on Twitter
My name is Christiaan Huizer and I support SMB with calculations (budgets and planning) using Coda, and sometimes Mailjet, Zapier & Paperform to get the job done. I stay a way from general Coda consulting. The Coda Community provides great insights for free once you add a sample doc.