The Lookup function uses the syntax lookup(...

(Marc Dillon) #1

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.

(Aleksi Alkio) #2

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

(Marc Dillon) #3

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?

(Aleksi Alkio) #4

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.

(Steven Coile) #5

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