Companion film
One series, three futures
Change one month of units and watch mapped revenue, cumulative totals, and three scenario futures recalculate together.
49 secGrid 0.63.2
Open film page →Guided build · 03
Turn paired series into cumulative and scenario analytics, then choose native collections when the job needs keyed, unique, or queued state.
You will finish with: A shaped scenario model plus a practical map from workbook arrays to List, Map, Set, Deque, and functional pipelines.
First, a five-month revenue model with a cumulative series and bear/base/bull scenarios. Then you will inspect a fulfillment model to learn when an Array should give way to a List, Map, Set, or Deque.
Download the starter above, then complete the first formula from the canonical Array Analytics example:
A1 = [120, 135, 142, 150, 168]
A2 = [42, 44, 47, 49, 52]
A3 = MAP(A1, A2, (units, price) => ROUND(units * price, 2))
Checkpoint:
A3 = [5040, 5940, 6674, 7350, 8736].
MAP preserves the five-element shape while the lambda combines corresponding unit and price values.
A4 = SCAN(0, A3, (acc, value) => ROUND(acc + value, 2))
A5 = REDUCE(0, A3, (acc, value) => ROUND(acc + value, 2))
A6 = ROUND(A5 / 5, 2)
Checkpoint:
A4 = [5040, 10980, 17654, 25004, 33740],A5 = 33,740, andA6 = 6,748.
Use SCAN when every intermediate accumulator matters. Use REDUCE when only the final accumulator matters.
G1 = [0.92; 1.00; 1.08]
G5 = [INDEX(A3, 1, month) * INDEX(G1, scenario, 1) FOR scenario IN 1..3, month IN 1..5]
M5 = BYROW(G5, row => SUM(row))
G9 = BYCOL(G5, col => AVERAGE(col))
The three rows are bear, base, and bull. The five columns are months.
Checkpoint:
M5 = [31040.8; 33740; 36439.2]. Because the scenario multipliers average to1,G9 = [5040, 5940, 6674, 7350, 8736].
The compact outputs settle at A8 = 33,740, A9 = "bull-led", and A10 = "total=33740 avg=6748 scenario=bull-led".
Open the canonical Collection Pipelines example. It uses four native persistent collections:
| Need | Structure | Evidence in the model |
|---|---|---|
| Indexed revisions | List | A1:A6 |
| Keyed lookup | Map | B1:B7 |
| Unique membership and algebra | Set | C1:C9 |
| Push/pop at both ends | Deque | D1:D14 |
Updates return new revisions; they do not mutate the prior value.
Checkpoint:
A5 = 5while revisedA4has lengthA6 = 6;B4 = 92,B5 = 0,B6 = 4, andB7 = FALSE;C6 = TRUE,C7 = FALSE,C8 = 7, andC9 = TRUE;D4 = "j-0987",D5 = "j-1044",D12 = 3, andD13 = FALSE.
F1 = VECTOR_TO_ARRAY(A4)
F2 = F1 |> FILTER(quantity => quantity < 10) |> MAP(quantity => (10 - quantity) * 6.25) |> SUM()
VECTOR_TO_ARRAY makes the native List explicit at the workbook boundary. The terminal pipeline keeps filter, transformation, and aggregation together.
Checkpoint:
F1 = [6, 12, 7, 25, 3, 9]andF2 = 93.75. The delivery-log fold also producesF6 = 55units of ink.
In Array Analytics, change the last units value from 168 to 180.
Checkpoint: the last monthly revenue is
9,360;A5andA8become34,364;A6 = 6,872.8; andM5 = [31614.88; 34364; 37113.12].
In Collection Pipelines, change VECTOR_SET(A1, 1, 6) to VECTOR_SET(A1, 1, 8).
Checkpoint:
F1 = [8, 12, 7, 25, 3, 9]andF2 = 81.25. The originalA1still has five entries and its fourth value remains25.