Initial value to be the previous value of adjacent column

I want the initial value of a form value to equal the previous value of the adjacent column.
The formula would look like this R[-1]C[1] but this canโ€™t be entered for initial value. How do i do this?

I could create another column which has this value but it seems overkill.

Cheers
Steven

Solved Solved
0 7 2,646
1 ACCEPTED SOLUTION

Nice one. This worked just fine. Thanks you very much indeed.

View solution in original post

7 REPLIES 7

There are [_THISROW_BEFORE] and [_THISROW_AFTER] variables. You might see if you can use the [_THISROW_BEFORE].[Adjacent_Column] in the initial value of your problem column.

I have never used these in a Form view, so I am not certain if they are available there.

If that doesnโ€™t work, I donโ€™t see any way you can get around using another column.

I believe these are only available in workflow expressions.

Yeah, I wasnโ€™t sure and didnโ€™t have time to check myself. Maybe a feature request?

Good point! I wasnโ€™t thinking in sheet terms. I was assuming editing of an existing row.

Steve
Platinum 4
Platinum 4

Row and column adjacency really isnโ€™t a thing with AppSheet, so best to reconsider your requirement. It sounds to me that you want the initial value of some columnโ€“letโ€™s call it ColumnAโ€“to come from a different columnโ€“ColumnBโ€“of the previous most-recently-added row. Set the Initial value expression for ColumnA to something like this:

ANY(
  SELECT(
    MyTable[ColumnB],
    ([_ROWNUMBER] = MAX(MyTable[_ROWNUMBER]))
  )
)

[_ROWNUMBER] refers to a rowโ€™s number in the spreadsheet. Assuming the rows in your spreadsheet are added in chronological order, oldest at the top and newest at the bottom, the newest row will have the highest row number. MyTable[_ROWNUMBER] (replace MyTable with the name of your table) gives a list of row numbers in your table.

See also:





Nice one. This worked just fine. Thanks you very much indeed.

This is helpful to me also, Thanks

Can I do some math calculations with this Like ColumnA - ColumnB?

I tried but couldn't do it

Thanks for this

I was stuck at this for so many days

Your solution is perfect and simple

Top Labels in this Space