CDavidOrr
08-31-2022Cloud Apps
Using Coalesce with Lookup in a custom column
I need to create a custom column on one of my tables. This column will be a LOOKUP from another table. However, if the current row has no match in the remote table, I want to use the value from the current match column. Here is what I am attempting to use:
COALESCE(Lookup([AccMapping], [AccessorialName], [EdiCode], [Code]), [EdiCode])
So if the Lookup returns a NULL, I want EdiCode to be used.
However, this is generating a parsing error "Unhandled case label: LookupRemoteTableExpression".
I would appreciate any suggestions on how to accomplish this.
Hi CDavidOrr ,
Try 'case' statement as below:
case when Lookup([AccMapping], [AccessorialName], [EdiCode], [Code]) = null then [EdiCode] else Lookup([AccMapping], [AccessorialName], [EdiCode], [Code]) end-Hari