LOOKUP with wrong result

Hello,

I’m using LOOKUP expression in table named [PRODUCTS] to get a unique code from another table named [CUSTOMERS].

LOOKUP expression goes to the right Column which is CUSTOMER CODE but give me the wrong CUSTOMER CODE that refers to the PRODUCT CUSTOMER NAME i choose.

This is the expression i’m using :

LOOKUP([PRODUCT CUSTOMER NAME],“CUSTOMERS”,“PRODUCT CUSTOMER NAME”,“CUSTOMER CODE”)

  • PRODUCT CUSTOMER NAME : is a column in table [PRODUCTS] where i’m using the LOOKUP expression
    CUSTOMERS : is the table where LOOKUP expression needs to get the right value from CUSTOMER CODE column

Please help me with that
Many thanks

You need to add [_THISROW] so your LOOKUP() would understand to read the value from a record where you trigger this formula.

LOOKUP([_THISROW].[PRODUCT CUSTOMER NAME],“CUSTOMERS”,“PRODUCT CUSTOMER NAME”,“CUSTOMER CODE”)

1 Like

Hi

i got the same wrong result…

Any change that you have more than one value in your Product Customer Name column?

PRODUCT CUSTOMER NAME column is a REF type from table CUSTOMERS so i can only choose from

And you have the same “Product Customer Column” in both tables?

you mean PRODUCT CUSTOMER NAME ? not PRODUCT CUSTOMER COLUMN right ?
if yes no not the same nomination in both tables

Have you tried dereference formula like… [PRODUCT CUSTOMER NAME].[CUSTOMER CODE]

No How i do that ?

When you have a Ref field in your Products table already, you can call what ever column’s value from the Customers table with a deref formula…
[YourRefColumnName].[ColumnNameInCustomersTable]

so i need to add the column CUSTOMER CODE is table PRODUCTS so i can call later right ?

yeah it works !
thank youuu

1 Like

Good :slight_smile:

a very easy way to get the unique CODE