My favorite feature of grist is when i rename a column, The formula’s referencing that column get updated with that new name automatically. So much time and frustration this has saved me!
I noticed that it is failing to update the column name in the second last line of this formula. It remains “Row_Timestamp” where as the rest of the reference’s have correctly changed to “row_timestamp_pb”
if not $Placed or not $Placed_Timestamp:
latest = Portfolio_balance.lookupOne(order_by="-row_timestamp_pb")
return latest.h_total_cash_pb if latest else 0
else:
candidates = [
p for p in Portfolio_balance.all
if p.row_timestamp_pb and p.row_timestamp_pb <= $Placed_Timestamp
]
if not candidates:
return 0
snapshot = max(candidates, key=lambda p: p.Row_Timestamp)
return snapshot.h_total_cash_pb
Its happened multiple times for me. here is another formula from the same instance.
if not $Placed or not $Placed_Timestamp:
latest = Portfolio_balance.lookupOne(order_by="-row_timestamp_pb")
return latest.o_total_cash_pb if latest else 0
else:
candidates = [
p for p in Portfolio_balance.all
if p.row_timestamp_pb and p.row_timestamp_pb <= $Placed_Timestamp
]
if not candidates:
return 0
snapshot = max(candidates, key=lambda p: p.Row_Timestamp)
return snapshot.o_total_cash_pb
I just thought I would highlight this for the devs in case its helpful.