cancel
Showing results for 
Search instead for 
Did you mean: 

lookup confusions!!!!

Former Member
0 Kudos
565

Hi Friends,

Am new to BODS...i want to know the syntax for lookup function(not lookup_ext)  for comparing two column in lookup table...

for one column i could do that

syntax: lookup(TABLE_NAME,RESULT_COLUMN,DEFAULT VALUE, CACHE,COMPARE COLUMN, EXPRESSION)

condition :lookup(DEW_EnterpriseWarehouse_DS01.DBO.EMP, EMP_NO, -1, 'NO_CACHE', EMP_FIRST_NAME, SRC_EMP_FIRST_NAME) am getting the right output

But my question is how to compare two column in single lookup function.....

in the above example am using first name and taking the emp_id ...but i want to take emp id based on firstname and last name ....how to do that with the help of lookup function.....

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Gokul ,

You can use a lookup function with two expression and compare_column pairs take a look at the example below:

lookup(sap_ds..VBUP, GBSTA, 'none', 'NO_CACHE', VBELN, VBAK.VBELN, POSNR, VBAP.POSNR)

This function returns the value from the GBSTA column in the VBUP table that corresponds to the VBELN value in the VBAK table and the POSNR value in the VBAP table. When no corresponding value is found, the function returns "none."

Former Member
0 Kudos

Thanks sandeep....


I re framed it below as per my under standing pls correct it if am wrong....


Lookuptable  Source Table

VBELN     =    VBAK.VBELN

POSNR    =      VBAP.POSNR

return column = GBSTA

and my 2nd question is can we able to use other relation operator(!=,<,>) in lookup function If yes pls provide me some example....

Answers (1)

Answers (1)

abhi2636
Participant
0 Kudos

Hi Gokul,

You can look up only 1 column from a table or file using Normal lookup() function.

You should use lookup_ext() function if you wanted to look up multiple columns from a table or file.

Regards,

Abhi

Former Member
0 Kudos

Thanks Abhi...