Copy the latest Value From One Table to Another

In my application, there are two tables named Table_1 and Table_2. I need to get the most recent 'Status' value for a given customer from Table_2, based on the latest date, and then update the 'Status' column in Table_1 corresponding to the same Customer Number.

I've tried each of the following expressions in an Action with a Bot to make the change when an entry is added to Table 2 but, have had no luck in getting them to work:

  • MAXROW("Table 2", "Status", ([Customer Number] = [_THISROW].[Customer Number]))
  • ANY(SELECT(Table 2[Status], [Date Changed]=MAXROW("Table 2", "Date Changed",([Customer Number]=[_THISROW].[Customer Number]))))
  • LOOKUP([_thisrow].[Customer Number], "Table 2", "Customer Number", "Status")
Solved Solved
0 1 53
1 ACCEPTED SOLUTION

I figured it out with this expression:

LOOKUP( MAXROW( "Table 2", "Date Changed", [Customer Number] = [_THISROW].[Customer Number] ), "Table 2", "Customer Number", "Status" )

 

View solution in original post

1 REPLY 1

I figured it out with this expression:

LOOKUP( MAXROW( "Table 2", "Date Changed", [Customer Number] = [_THISROW].[Customer Number] ), "Table 2", "Customer Number", "Status" )

 

Top Labels in this Space