
Lookup function
I am trying to use lookup function for a scenario having values in a list e.g.
lookup(result lookup field, primary key field 1, primary key value 1, primary key field 2, (primary key value 2 or primary key value 2),...,default value)
is it possible to achieve this without having multiple lookup functions?
-
Mukul, this is how the lookup function works, but it usually works on a table, where you defined your (pkey_field1, pkey_field2,...) as a table key, using the Function field in the table screen. In your message, you are saying ' a scenario having values in a list'. Can you please explain this scenario more.
Regards,
Hichem
Reply -
Thanks Hichem for replying, I am trying to achieve below
Here I am pulling shipment_refnum_value from shipment_refnum table where shipment_refnum.shipment_gid is matching with shipment.shipment_gid and shipment_refnum.shipment_refnum_qual_gid in ('SBUX.CMS','SBUX.SOURCE_SYSTEM').
I tried using below formula column, its not throwing any validation error, but not sure if this is right.
Also I tried with two lookup functions with ifnull() but I am trying to avoid multiple lookup functions.
lookup(
SHIPMENT_REFNUM.SHIPMENT_REFNUM_VALUE,
SHIPMENT_REFNUM.SHIPMENT_GID,
SHIPMENT.SHIPMENT_GID,
SHIPMENT_REFNUM.SHIPMENT_REFNUM_QUAL_GID,
in(
'SBUX.CMS',
'SBUX.SOURCE_SYSTEM'
)
)
Reply -
For anyone else, this post provides a bit more information about how to use the function: https://community.incorta.com/t/63jl20/how-to-use-the-lookup-function
Reply -
Mukul Ranjan please refer to this video to see how to model the SQL that you shared in this post in Incorta.
Video:
- https://youtu.be/ahk0z468u7Y
I have created sample data for 2 tables that you have used in this SQL.
This video shows how you can model this SQL in Incorta using
- Joins
- Alias table
- Formula
Reply