# Time series data

**URL:** <https://connect.superhuman.com/t/time-series-data/1989>\
**Category:** Ask the Community\
**Created:** [August 23, 2018, 11:52pm UTC](https://connect.superhuman.com/t/time-series-data/1989 "2018-08-23T23:52:37Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Todd\_Olson](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/todd_olson/32/1967_2.png) [@Todd\_Olson](https://connect.superhuman.com/u/Todd_Olson)\
**Post date:** [August 23, 2018, 11:52pm UTC](https://connect.superhuman.com/t/time-series-data/1989/1 "2018-08-23T23:52:38Z")

</div>

I’m working on a financial modeling application and was wondering if anyone has tried to work with time series data in Coda, such as cash flows that are spread across a number of months?

---

<div class="post-metadata">

**Author:** ![Brandon\_Trew](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/brandon_trew/32/11525_2.png) [@Brandon\_Trew](https://connect.superhuman.com/u/Brandon_Trew)\
**Post date:** [May 5, 2020, 6:52pm UTC](https://connect.superhuman.com/t/time-series-data/1989/2 "2020-05-05T18:52:06Z")

</div>

Did you make any progress here Todd? I’m also interested in this

---

<div class="post-metadata">

**Author:** ![Connor\_McCormick](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@Connor\_McCormick](https://connect.superhuman.com/u/Connor_McCormick)\
**Post date:** [May 5, 2020, 8:15pm UTC](https://connect.superhuman.com/t/time-series-data/1989/3 "2020-05-05T20:15:51Z")

</div>

Somewhere in here there is a really brillant time series doc that you guys should see. I will try to find it

---

<div class="post-metadata">

**Author:** ![Connor\_McCormick](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@Connor\_McCormick](https://connect.superhuman.com/u/Connor_McCormick)\
**Post date:** [May 5, 2020, 8:21pm UTC](https://connect.superhuman.com/t/time-series-data/1989/4 "2020-05-05T20:21:08Z")

</div>

Ah… Todd it was your doc. But @Brandon_Trew this should help.

> [@Time & Money: Financial modeling prototype](https://connect.superhuman.com/t/time-money-financial-modeling-prototype/2271):
>
> Time & Money I am setting out to build a financial modeling platform in Coda that would make Coda not only competitive with Excel, but superior to Excel, for building and using financial models. I call it Time & Money. I know it sounds ambitious, but isn’t Coda itself pretty ambitious? So far, I have created a relatively simple prototype that demonstrates how a financial modeling platform in Coda might work. It demonstrates: That time series data, such as monthly cash fl…

---

<div class="post-metadata">

**Author:** ![Brandon\_Trew](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/brandon_trew/32/11525_2.png) [@Brandon\_Trew](https://connect.superhuman.com/u/Brandon_Trew)\
**Post date:** [May 5, 2020, 10:44pm UTC](https://connect.superhuman.com/t/time-series-data/1989/5 "2020-05-05T22:44:39Z")

</div>

Thank you, but that link isn’t working any longer. Can you try update the link, or share the published version?

In the mean time I was playing around, and came up with this as a simple starting point: [https://coda.io/@brandon-trew/template-time-series-scenario-modeling](https://coda.io/@brandon-trew/template-time-series-scenario-modeling)

---

<div class="post-metadata">

**Author:** ![Todd\_Olson](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/todd_olson/32/1967_2.png) [@Todd\_Olson](https://connect.superhuman.com/u/Todd_Olson)\
**Post date:** [May 8, 2020, 3:25pm UTC](https://connect.superhuman.com/t/time-series-data/1989/6 "2020-05-08T15:25:17Z")

</div>

Thank you @Connor_McCormick and @Brandon_Trew for your interest. I have now published the Time & Money prototype at [https://coda.io/@cic-service/time-money-prototype](https://coda.io/@cic-service/time-money-prototype).

---

<div class="post-metadata">

**Author:** ![Connor\_McCormick](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@Connor\_McCormick](https://connect.superhuman.com/u/Connor_McCormick)\
**Post date:** [May 8, 2020, 4:24pm UTC](https://connect.superhuman.com/t/time-series-data/1989/7 "2020-05-08T16:24:00Z")

</div>

Hi @Todd_Olson,

There seems to be some formatting strangeness in the Rules section:

 ![image](https://global.discourse-cdn.com/coda1/original/2X/3/3d828935e6321db04cd65af578f8c08f25545c51.png)

---

<div class="post-metadata">

**Author:** ![Brandon\_Trew](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/brandon_trew/32/11525_2.png) [@Brandon\_Trew](https://connect.superhuman.com/u/Brandon_Trew)\
**Post date:** [May 8, 2020, 6:34pm UTC](https://connect.superhuman.com/t/time-series-data/1989/8 "2020-05-08T18:34:57Z")

</div>

Thanks Todd,

This is outstanding. You’ve really inspired me with this (as a LONG time excel modeling geek - [here’s my published excel course](http://beyondformulas.com)). Without exaggerating, I think this could be the killer app that helps improve on excel (for all the reasons you mentioned)

You’ve blown my mind with:

- REALLY smart with the separation of rules.
- And really interesting separation of the schedules logic (define the discreet time periods upfront). Really novel use of these two structural components.
- The use of “top grouping” to create the output “pivot table” is genius. I totally missed that this was possible. I’m in love.

I think the combination of our two docs ([here’s mine](https://coda.io/@brandon-trew/template-time-series-scenario-modeling)) would make it a complete package:

- My approach to scenario paramaterization would meaningfully improve your template I feel, given how scalable it it to add scenarios. It’s also really easy to use them in formula.
- I also found a way to fully automate creation of the time periods, using a little hack of both buttons and formulamap. This would let you autogenerate your entire cashflow table dynamically. There’s also a button to clear the whole table, so that it’s easy to keep “fresh”. Thinking ahead - would be amazing to add an “actuals” table separately. Then to have a rule that pulls actuals into the core cashflow model when available (so that doing BvAs becomes a cinch)

**Quick FYI:** you need a line break after the intro text in the Rules table (see image):

 ![Screen Shot 2020-05-08 at 11.23.53 AM](https://global.discourse-cdn.com/coda1/original/2X/5/51278da30b69332b726945ae881d1f2e7047d22b.png)

---

<div class="post-metadata">

**Author:** ![Todd\_Olson](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/todd_olson/32/1967_2.png) [@Todd\_Olson](https://connect.superhuman.com/u/Todd_Olson)\
**Post date:** [May 9, 2020, 12:30am UTC](https://connect.superhuman.com/t/time-series-data/1989/9 "2020-05-09T00:30:51Z")

</div>

Formatting should be okay now. Coda created some formatting options since I first created this prototype that I needed to respond to.

---

<div class="post-metadata">

**Author:** ![Todd\_Olson](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/todd_olson/32/1967_2.png) [@Todd\_Olson](https://connect.superhuman.com/u/Todd_Olson)\
**Post date:** [May 9, 2020, 12:34am UTC](https://connect.superhuman.com/t/time-series-data/1989/10 "2020-05-09T00:34:17Z")

</div>

@Brandon_Trew, thank you so much for your kind comments. I will look at your doc; it sounds like an exciting possibility for improving on what I did. I haven’t worked on Time & Money in a while, but you, along with some other commenters, are getting the juices flowing again. I need to decide if/how/with what resources to pursue this further.

---

<div class="post-metadata">

**Author:** ![Connor\_McCormick](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@Connor\_McCormick](https://connect.superhuman.com/u/Connor_McCormick)\
**Post date:** [May 9, 2020, 2:04am UTC](https://connect.superhuman.com/t/time-series-data/1989/11 "2020-05-09T02:04:09Z")

</div>

I really like this. I love how I can change the content of the initial data column interactively, even after hitting the model button, and it updates dynamically.

In particular, this gem (in column BTN\_Create\_Time) is super useful:

```auto
FormulaMap(
      Sequence(1, thisRow.End_Date-thisRow.Start_Date),
      AddRow([Time series Model], 
            [Time series Model].Scenario, thisRow,
            [Time series Model].Date,
                       thisRow.Start_Date+CurrentValue)
)

```

It’s so useful and probably common it should _almost_ be considered a candidate for being its own formula. Perhaps something with this signature, `AddRows(TargetTable, Iterable, Column 1, Value 1, Column 2, Value 2...)` so you would have `AddRows(TableName, Sequence(1, End Date - Start Date), Scenario, thisRow, Date, Start Date + CurrentValue)`

Couple questions:

1. Why not use a multiselector for your Scenario matches selector?
2. Why not disable the buttons in BTN\_Create\_Time when the Time series Model table already contains that row’s scenario? (Could be disabled with `[Time series Model].Scenario.Unique().Contains(thisRow)`)
3. Finally, and somewhat strangely, the Time Series Chart comes out to show 10PM with your rows, but with mine it ends on the exact date. Fixed this by reselecting the end date. Bug worth keeping in mind. ![image](https://global.discourse-cdn.com/coda1/original/2X/d/d4f513523aa6bff27ac9812b4f07c6937c30518c.png)

---

<div class="post-metadata">

**Author:** ![Brandon\_Trew](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/brandon_trew/32/11525_2.png) [@Brandon\_Trew](https://connect.superhuman.com/u/Brandon_Trew)\
**Post date:** [May 9, 2020, 6:49pm UTC](https://connect.superhuman.com/t/time-series-data/1989/12 "2020-05-09T18:49:48Z")

</div>

Thanks for the feedback!

1. What do you mean by multi-sector for scenario selector? Do you mean that the variables could change (by time or something) even within a scenario?

2. The main reason you need to hit the button, is when you change the time ranges for a scenario. If you just change parameters, then the model updates by itself. So you’d need to run a check whether the min date and max date were the same as in the scenario.

3. That bug is strange. I can’t get my chart labels to fix. What do you mean by “Fixed this by reselecting the end date.”?

---

<div class="post-metadata">

**Author:** ![Connor\_McCormick](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@Connor\_McCormick](https://connect.superhuman.com/u/Connor_McCormick)\
**Post date:** [May 11, 2020, 8:50pm UTC](https://connect.superhuman.com/t/time-series-data/1989/13 "2020-05-11T20:50:58Z")

</div>

1. Multiselector just lets you select multiple options at the same time. It’s nice if you want to compare just a subset of the Scenarios. Found under the selector settings:  

2. I noticed that if I hit the button multiple times it seemed to create a new scenario each time. Maybe it should first delete the existing matching scenario before creating the new one? Would also be cool if it only became available to press if that exact scenario wasn’t already created, then I would know that I should press the button again whenever it turned pink.

3. I mean I just clicked the same end date that was already there, and then clicked the Model! button. I’m guessing it started as a datetime type column, and has subsequently been turned to only a date column.

---

<div class="post-metadata">

**Author:** ![Brandon\_Trew](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/brandon_trew/32/11525_2.png) [@Brandon\_Trew](https://connect.superhuman.com/u/Brandon_Trew)\
**Post date:** [May 12, 2020, 12:35am UTC](https://connect.superhuman.com/t/time-series-data/1989/14 "2020-05-12T00:35:31Z")

</div>

1. Dope. I misread as multi-SECTOR". multi-selector makes a lot more sense, yes! I actually really dislike the usability of the multi-selector component. It’s super clunk to use I find when most of the useful interactions come from “filter one”, or “all”. For the chart, you’re right that multi-select would be better. I really wish Coda team would redesign it like Google Sheets does 0 with a list of checkboxes, and an “all / none” hotlink above". This list, with the “x’s” is really clumsy.

2. Good points. I’ve tweaked the logic, to disable the row buttons if the table is populated. When in practice, I planned to hide the row buttons entirely, and have the model run _only_ from the “run model” button. Much easier to reset the whole table once in a while, than try hand tune the individual scenarios. I’m sure when the models get really large, this will become too cumbersome and will need a more surgical approach.

3. Got word from support - there’s a bug in which the chart doesn’t respect the table column formatting. As you say - this started because I had changed the time inputs while it was still a date+time column, before changing to date only. I’ve deleted the original values and rerun it, so it’s now working.

Thanks for the quick-fire feedback.

I’m working on a new version that can handle more extensive model logic (building on Todd’s time and money framework, which I love). Will share with you once I’m a little further. Keep it coming!

---

<div class="post-metadata">

**Author:** ![Connor\_McCormick](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@Connor\_McCormick](https://connect.superhuman.com/u/Connor_McCormick)\
**Post date:** [May 12, 2020, 2:02am UTC](https://connect.superhuman.com/t/time-series-data/1989/15 "2020-05-12T02:02:17Z")

</div>

1. Ah that’s funny, I misread your sector as selector. I was thinking to myself, “This guys sure does seem to have a good grasp of Coda to not have encountered multi-selector.” But that makes sense now.
2. Yeah I think I agree with your choice to only “Run Model”, though for really slow calculations, or multiple scenarios there may be an argument on behalf of the “Update Scenario” option. Might be nice to use conditional formatting to indicate to the user when they would need to update the scenario (i.e. they changed a date) vs it auto updates (i.e. changed only the Initial Value)
3. Nice!

Very excited to see it! Nice work!
