Hi @UweG ,
We don’t yet offer an easy way to do this. What you need are LAG
and LEAD
formula functions which we hope to offer one day but aren’t planned for the near future. The key problem with this functions is:
- You create a formula as you describe
LEAD('Counter reading')-field('Counter reading')
- Now the formula’s cells depend on the order of your rows
- What happens if you change the sortings on your table, should all these formula cells be recomputed every time?
- What happens in your other grid views, you can have many different views of the same formula cells each with different sorts. We can’t calculate different cell results in the same table per view.
My only idea so far is that the LAG
and LEAD
functions need to be given a Grid View name as a parameter to use the sorts from that grid view when picking the next/previous row:
lead('Counter reading', 'My Grid View 10') - field('Counter reading')
. Alternately perhaps the lead
function could take a list of fields to sort by like so: lead('Counter reading', 'Sort Field 1
, +Sort Field 2')
etc.
Would something like this make sense to you? Do you have any other suggestions on how to implement these functions :)?
One not great workaround
For now you could use the Link to Table
field like so to achieve this in a manual way:
- Create a
Link to Table
field, point it at the same table
- Link every row to it’s next row
- Create a formula which is
lookup('Link to next row', 'Counter reading') - field('Counter reading')
But this is very manual and not ideal.