How to find the most recent log entry for each item?

I am creating an app that will display the current location of an instrument set (Tray_Number). Users enter in the date, Tray_number being used, location of the Tray_number is being used, and user who used the tray. This info is compiled into a log. How can I create a slice that looks at the log and returns the most recent entry for each Tray_Number?

I tried the following filter condition in the slice:
MAXROW(“Tray_Number”, “Timestamp”)

This is returning all log entries. I would just like to see each Tray_Number listed with the information from the most recent time it was used. Any ideas?

Conditions always need a Yes/No result. MAXROW() returns a key value. It’ll probably work for you with this simple addition:

[_THISROW] = MAXROW(“Tray_Number”, “Timestamp”)
1 Like

Unfortunately this didn’t work. It is still displaying all log entries.

Will?

What log are you talking about?
Lots of misunderstood data in your question (data-structure, relations)

1 Like

Sorry, let me better describe what I am trying to do. I am creating an app that will keep track of when and where instruments are used. Each instrument has a unique ID. Users fill out a form (Timestamp, date, location, user, instrument ID) each time they use an instrument. The info is compiled into a table named “Log”. Timestamp is used as the key for “Log”

What I am trying to do is have a instrument status page that lists each instrument ID with its current location and user who is using said instrument. I have created a slice of “Log” that contains the timestamp, instrument ID, location, and user. I am trying to look up the row with the most recent timestamp for each instrument ID (Tray_Number), and then display this information. I tried using the following expression:

[_THISROW] = MAXROW(“Tray_Number”, “Timestamp”)

This is returning the information for every entry into “Log”. Does this clarification help?

Hi @Garin

That may help you

1 Like

This:

(
  [_THISROW]
  = MAXROW(
    “Tray_Number”,
    “Timestamp”,
    ([_THISROW].[Instrument ID] = [_Instrument ID])
    )
)
1 Like