How to get most recent item from a list

I created two virtual columns in my parent table to show “Checked In” and “Checked Out” and then created format conditions to highlight names of employees that were currently checked in. Worked great until I had more than one line of check in, check out.

In the VC I have this: [Related DEMO Personnel Time in Time Out Sheets][Check In Time]

Is there a way to write an expression that looks at the most recent row from the time table (child)?

0 7 1,045
7 REPLIES 7

I did also try this expression but it gives me the name not the timestamp.

MAXROW(“DEMO Personnel Time in Time Out Sheet”, “Check out Time”, [_THISROW] = [MACCID])

If I have someone that checks in and out multiple times I need a way to get the values from the most recent row so that all my formatting works.

I assume that “DEMO Personnel Time in Time Out Sheet” is a different table than the one in which your specified VC lives in

I am not aware of way that you can use MAXROW() AND dereference a value from the returned row reference. SO, I would handle this in two parts.

  1. Create a hidden VC for “Recent Row” and in the App Formula use your MAXROW() expression.
MAXROW(“DEMO Personnel Time in Time Out Sheet”, “Check out Time”, 
[_THISROW].[ID] = [MACCID])

Note the change from [_THISROW] to [_THISROW].[ID] - whatever the proper [ID] column is

  1. Now I would change your exisiting VC column expression to:
    [Recent Row].[Check In Time]

Am I creating the maxrow VC in the time table?

Sorry, no it would be in the same table as your current VC.

Did you get figured out?

I think so! In the maxrow expression I had to change the col to rownumber instead of check out time and change the check in and check out columns from list to datetime and wa la! all the formatting and actions are working as expected!

Thank you so much!

HI Tammi,

I played around with similar issue for ages, I found that creating a DATA SLICE that filtered the [child table] using the most recent [Parent Key Column]

This assisted heaps in applying conditional formatting etc. as well as values of other columns in the same row.

Hope below helps

[_ROWNUMBER] =
MAX(
SELECT(
Child Table[_ROWNUMBER],
([Parent Table Key Column] = [_THISROW].[Parent Table Key Column])
)
)

Top Labels in this Space