LOOKUP function not working with tables from MariaDB database

I have an app that uses database from my hosting cpanel. Everything was good until I use the LOOKUP function. This works when I use google spreadsheet as database but not with Mysql ,

Warehouse Table:

Warehouse_Location

This is the lookup formula to get the warehouse name from warehouse table using the Warehouse Code

LOOKUP([_THISROW].[WarehouseCode], “wms_warehouse_h”, “WarehouseCode”, “WarehouseName”)

Thanks for helping in advance.

Try removing the [_THISROW] qualifier. I believe it causes issues in the LOOKUP() function.

I hope this helps!

Usually the problem is the other way: a missing [_THISROW]. causes problems.

Given that it works in Sheets but not MySQL, I’d suspect the MySQL table is not structured the same way as the worksheet. Alternatively, there are security filters on the table that behave differently between the two source types (because security filters are implemented differently for SQL sources) and the expected rows aren’t making it to the app. The first step here is to confirm that the app has the expected rows loaded, and that the columns of those rows contain the expected values.

2 Likes

Oh, ok!! Thanks for correcting me! I never use the LOOKUP() function anyway. I always use ANY(SELECT(…)). I just remembered there was a common mistake made when using the function and since it seems reasonable to NOT have to include the [_THISROW] qualifier (there can’t be any ambiguity), I remembered the rule incorrectly!!

1 Like