As is described here, adding a single column allows you to access the previous row with prev() and the new value of the previous row with prev().newValue<T>().
df.add {
"fibonacci" from {
if (index() < 2) 1
else prev()!!.newValue<Int>() + prev()!!.prev()!!.newValue<Int>()
}
}
but unfortunately, since from {} provides a DataRow as context instead of AddDataRow, newValue() is unavailable.
I don't know whether this was done due to a technical limitation, but if it was an oversight it surely must be added.
As is described here, adding a single column allows you to access the previous row with
prev()
and the new value of the previous row withprev().newValue<T>()
.This enables:
I'd expect this to be equivalent:
but unfortunately, since
from {}
provides aDataRow
as context instead ofAddDataRow
,newValue()
is unavailable. I don't know whether this was done due to a technical limitation, but if it was an oversight it surely must be added.