I need to use last entry [_thisrow-1].[thing]

Hi Team, how can i solve this problem?
[_thisrow-1] not runs and i need one diferent option for this expression:

IF([_thisrow-1].[thing]=“1”, “2”,
IF([_thisrow-1].[thing]=“2”, “1”,
“3”))

thks in advance,

What is the problem you need solved? What you’ve posted makes no sense.

sorry Steve,
I need to use the information of a cell of the penultimate line [thing] that have entered.
this is my idea but … I need your help.

IF([_rownumber-1].[thing]=“1”, “2”,
IF([_rownumber-1].[thing]=“2”, “1”,
“3”))

[_rownumber-1] isn’t a thing, so that’s not going to work.

[_thisrow-1] has nothing to do with the order of rows in a table.

When you say you want “the penultimate line”, do you mean “the second-to-last row”, or do you mean “the row immediately above the current row”?

“the row immediately above the current row.

1 Like

Try:

SWITCH(
  LOOKUP(
    MAX(
      SELECT(
        table[_ROWNUMBER],
        ([_ROWNUMBER] < [_THISROW].[_ROWNUMBER])
      )
    ),
    "table",
    "_ROWNUMBER",
    "thing"
  ),
  "1", "2",
  "2", "1",
  "3"
)

making appropriate substitutions for table (twice) and thing (once).

1 Like

Runs!
thks a lot again for you fantastic help.

1 Like