Can I select/filter with a variable table name in the expression

Hello, I am trying to sort if the following is possible:
Using a select/filter expression where to Table Name depends on a choice I made in the form before.
So the Table Name in the expression depends on condition before…

SELECT(Table Name[First Name], TRUE)

I am trying to have a IF expression; IF Table Name= x, SELECT(x[First Name],…), IF Table Name=y, SELECT(y[First Name],…), etc

Thanks Muk

Hope someone can help, any expression/idea will help

0 4 373
4 REPLIES 4

If the possible tables are fixed, you can look into IF and SWITCH statements and just duplicate the entire expression within each case, but for a different table. Not sure what the performance of this would be, however.

Steve
Platinum 4
Platinum 4

The first argument of a SELECT() has two forms:

  • A table-column reference (e.g., Products[Price]). A table-column reference must be provided as a fixed value; you cannot use an expression to identify the table or the column.

  • A list dereference (e.g., [Related Order Details][Price]). A list dereference must be given as a fixed list-dereference expression.

This is exactly the correct approach.

Yep!

See also:

Hi Steve, thank you for the feedback.

I used in another app…LINKTOFORM([Inspection Checklist]&"_Form", … here an expression is possible.
So I understand in SELECT expression this is not possible…

Regards Muk

Correct.

Top Labels in this Space