Slice Row Filter - Last row of each asset that matched criteria

Hey All,

I have this formula:

MAXROW(“Daily Checklist”,“_Rownumber”,
AND([Fault Status]=“Fix Immediately”,[Asset ID]=[_THISROW].[Asset ID]))

Which works perfectly. Until I hit save.
Appsheet determines this to not return a true or false like a row filter should.
Any ideas on how to fix it?

Please try the following slice filter expression

[Key column of Daily Checklist Table]= MAXROW(“Daily Checklist”,“_Rownumber”,
AND([Fault Status]=“Fix Immediately”,[Asset ID]=[_THISROW].[Asset ID]))

The following expression

MAXROW(“Daily Checklist”,“_Rownumber”,
AND([Fault Status]=“Fix Immediately”,[Asset ID]=[_THISROW].[Asset ID]))

does not work because it returns the key columns of the row(s) that meet the conditions in the expression. Slice filters need to evaluate with a TRUE or FALSE. So the result needs to be compared with the [Key column] of the table to return a TRUE or FALSE as result and return the matching row(s) in the slice.

1 Like

How do I get the last row of this thing only?

Sorry everyone. I had tried this but I was using what I thought was the key column. Turns out I was thinking of a different table. All sorted with key=“formula from initial post”

1 Like

I prefer:

(
  [_RowNumber]
  = MAX(
    SELECT(
      Daily Checklist[_Rownumber],
      AND(
        ([Fault Status] = "Fix Immediately"),
        ([Asset ID] = [_THISROW].[Asset ID])
      )
    )
  )
)

What is the reason @Steve ?

Is it computationally cheaper?

Not significantly.

I prefer it because _RowNumber is in every table, so I can copy this expression for use elsewhere with fewer modifications.

You don’t have to know the table’s key column off the top of your head, and you don’t have to change the expression if the key column name changes.

There are conditions where a table can have duplicate key column values, so relying on its uniqueness doesn’t always work. _RowNumber will never have duplicate values.

2 Likes