The Lookup function uses the syntax lookup(...

The Lookup function uses the syntax

lookup([column],“table”,“column”,“column”)

Shouldn’t it be:

lookup([column],“table”,[column],[column])

to fit with all (most?) other syntax?

Just seemed odd to me, very hard to remember, I have to look it up every time.

1 7 668
7 REPLIES 7

You are probably looking for… LOOKUP([_THISROW].[column],table,column,column)

Why do you say that? Wouldn’t any column reference as the first argument be parsed on a row-by-row basis anyways?

I was more-so just pointing out that the 3rd and 4th column arguments are put into quotes instead of brackets. Why is that?

You need to say [_THISROW].[Column] if you are looking the value from outside of your source table. It’s the same than with SELECT expression. You don’t need to use quotes if you don’t use any special column names like “Date” etc. so the parser will read them as column names, not as an expression.

LOOKUP() is effectively a preprocessor macro around ANY(SELECT()).

New to AppSheet and not sure what the other responses are talking about but your question helped me today. Thank you for posting it. I was using the typical column syntax and got an error about not having enough arguments. As soon as I switched to “” syntax you point out the expression worked as expected. I cannot thank you enough!

I’m glad my newbie mistakes from 2 years ago have helped you out.

The key here is at [column] returns the value from that column. The lookup expressions is needing column names for the 3rd and 4th arguments, not values from a column.

For reference:

Top Labels in this Space