Get and use table name from a drop down list value

I would like to use the value from a drop down list to reference a table. i.e I have 4 trucks in the drop down list and each truck has its own table. When I choose the truck called “Acco” from that list (Column name is “Truck”) I want to find the last row in the “Acco” table.

I think I’m ok with finding the last row, but I can’t get the value from the drop down list to be the table name. I have been trying using [Truck] as the table name but all the expressions fail when I do that. If I replace [Truck] with “Acco” the expression works fine.

I have also tried TEXT([Truck]) and [_THISROW].[TRUCK] but nothing has worked so far.

Any help would be great.

Rob.

Solved Solved
0 5 202
1 ACCEPTED SOLUTION

Steve
Platinum 5
Platinum 5

There is no way to use a column value to directly identify a table name for a reference, unfortunately. The best you can do is us a conditional to choose the suitable dereference:

SWITCH(
  [Truck],
  "Acco", LOOKUP(..., "Acco", ..., ...),
  ...,
  ""
)

Restructuring your data so that all trucks are contained in a single table is the right choice.

View solution in original post

5 REPLIES 5
Top Labels in this Space