[_THISROW] usage? "Unable to find column '_THISROW-3' "

I just wrote this expression into a virtual column:

MAXROW( Inventory Adjustment , “date” , AND( [_THISROW].[key] = [inventory] , [adjustment type] = “reset”))

It works, but first I tried to write this expression:

MAXROW( Inventory Adjustment , “date” , AND( [_THISROW] = [inventory] , [adjustment type] = “reset”))

I thought that would work. [key] column is the key column. [_THISROW] is an alias for the key column, is it not?

It throws the error:

Unable to find column ‘_THISROW-3’

Excuse me, what?

Where did you use this expression? I believe _THIUSROW-3 (and other _THISROW-n columns) are workflow template things.

In a virtual column’s app formula.

I have no explanation. :frowning:

Further testing shows that [_THISROW-1] makes this expression work as intended.

:man_shrugging:

I’ve experienced a similar thing in a workflow template, when using a SELECT inside of a START, logic (or at least, my logic…) makes you think it should be [_THISROW].[ ] , but it only works with [_THISROW-1].[ ]

Judging by the Expressions Assistant’s explanation of the expression, it looks like MAXROW with the third argument condition, is a nested SELECT.

[_THISROW-0] & [_THISROW+0] are also accepted by the editor, without errors, but do NOT work.

1 Like

I imagine MAXROW() is a macro, so this:

MAXROW(_table_, _column_, _select_)

is actually interpreted as something like this:

SELECT(
  _table_[key],
  AND(
    _select_,
    (
      MAX(
        SELECT(
          _table_[_column_],
          _select_
        )
        = [_column_]
      )
    )
  )
)
2 Likes