-
-
Notifications
You must be signed in to change notification settings - Fork 72
Description
Maybe I am misunderstanding the usecase for the op.lag window function, or window functions in general, but I would like to perform a computation on my table that referenced the current row in a different column and the previous row in the same column.
Essentially I would want to perform a calculation similar to the one I have tried to visualize in the table below. Note that this example is simplified to show the concept of what I am trying to achieve but the actual calculations involve multiple row look-back and not only addition.
| index | a | b |
|---|---|---|
| 0 | ... | ... |
| 1 | ... | () => a[1] + b[0] |
I assumed I could do that with the lag window function like this:
table.derive({ b: d => d.a + op.lag(d.b) })But it seems like window functions aren't able to use the calculations made for other rows.
How would I approach this problem using arquero, if it is possible at all?