Find repetitive formulas, place what’s in common in one column, then reference that column for all others.
If we show our column formulas for the five data points we’re calculating in strategies one and two, we can see what they have in common.
This isn’t just quite a bit of repetition, it’s also the more expensive part of the formula to calculate. Since strategy two was already an improvement of 5x, let’s start there and see if we can continue down this path of optimization.
Our goal for this strategy is to get everything highlighted as repetitive in the red boxes above down to one “worker column” called Sales Orders with the following formula:
The trick to this strategy isn’t just taking all repeated elements and only running them once, it’s that the formula we’re using returns row values instead of one piece of data from the column.
giving us this ability to use row values and all data within them. Thanks to our super-powered formula language, it only takes a . to extract any column specific values.
Since the tough work of the filter is already done and in the worker column Sales Orders, we simply reference that column, add a . and then type the column with the values we need.
Strategy three: country table =
Strategy three: sales report =
Count of Sales Orders per Country
Total Units per Country
Total Profit per Country
Total Cost per Country
Most Recent Ship Date per Country
There are no rows in this table
Total calculations for five data points: 189,000
This is over 25x more optimal than where we started with strategy one. And for additional data points, we actually have a 1,000x improvement. We’re not only more performant with calculations, we have much shorter and easier to understand formulas to work with as well as maintaining the gains from strategy two with easier to read aggregate data.
Wait, there’s more!
Since we returned row values with our Sales Orders column, and since row values contain the data for that row, Coda can display those values as subtables of the country table.
If we change the layout of the country table to a Detail view, we can then edit the layout and have those row chips displayed as an actual table.