Using [_thisrow_before] in a select fuction

I have a table with entries where a timestamp is calculated for each row.  I also am trying to use some validation rules that disallow overlaps in time for entries.

This formula, for some reason always returns zero

count(select(Production[Timestamp],[[_thisrow_before].[Timestamp]>[Timestamp]))

But when I make a virtual column "Timestamp Before Edit" that is the formula [_thisrow_before].[Timestamp]

and then evaluate:

count(select(Production[Timestamp],[_THISROW].[Timestamp Before Edit]>[Timestamp]))

it returns the correct value, why is this?

I have run into this issue before where I have to do an intermediate calculation in a virtual column, but I do not know why or when this is required.

0 4 53
4 REPLIES 4

In general speaking, the [_THISROW_BEFORE] and [_THISROW_AFTER] expressions were created for Bot so you could evaluate the condition is the value changed or not more easily. Both of these "Before" and "After" values are not stored anywhere. The app is only able to use them when the process is still going on.. like you have opened the form view and you have changed value in a column. Then the app still remembers what the old value was. But right after when you have saved it again, it doesn't remember it anymore.

The same goes with the Bot. When the Bot is triggered, it still remember the before value because the process is not ended yet. 

This also does not explain why it returns no value with the form open.

Should you use just this?
count(select(Production[Timestamp],[_thisrow].[Timestamp]>[Timestamp]))

I had the same problem with another formula where I was using ([refkey].[_rownumber]-1) inside an expression which returned nothing, but using a virtual column with the same expression I got the previous row number from the reference table.

Top Labels in this Space