Can you use a variable in the LOOKUP function for returnColumn?
I am having some trouble trying to use a variable as the returncolumn in a LOOKUP.
LOOKUP(lookupValue, tableName, lookupColumn, returnColumn)
I have a virtual column โDefaultTeamโ that contains the name of a column in a table. Trying to use it like this:
LOOKUP([match], โScheduleโ, โmatchnumโ, [DefaultTeam])
When I try this, Appshet errors stating that I need exactly 4 arguments. If I substitute [DefaultTeam] for a literal such as โRed1โ it works fine.
Do you see any way to do this?
How aboutโฆ LOOKUP([_THISROW].[match],Schedule,matchnum,DefaultTeam)
It looks like the last 3 inputs must be โconstant valueโ expressions, so I donโt think you can dynamically set the return column like that. I think Aleksiโs version will just look for a column called โDefaultTeamโ in the lookup table.
@Aleksi_Alkio @Adam_Stone_AppSheet Thanks - as Adam mentioned it seems like you cannot use a variable in that position. I guess this is now a feature request! Here are the errors I get:
using: * [DefaultTeam] - it states I need exactly 4 arguments.
One square bracket is missing. Try LOOKUP([_THISROW].[match],Schedule,matchnum,DefaultTeam)
User | Count |
---|---|
41 | |
31 | |
31 | |
16 | |
14 |