Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Lookup Function

Hi everybody.

I´d like to have a little help with this function, i´ve read a few posts but i still didnt understand.

I have this in the script, and i dont understand what it is.

IF(LEN(CUENTA)>2,lookup('CUEN_NOMBRE', 'CUENTA_AUX',LEFT(CUENTA,2), 'CUENTAS_TMP')) AS GRUPO_NOMBRE_2

Here an example of the values

CUEN_NOMBRE = activo

Cuenta_aux = 1

Cuenta= 1-1

and cuentas_tmp is a table.

Thank you all.

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

IF(LEN(CUENTA)>2,lookup('CUEN_NOMBRE', 'CUENTA_AUX',LEFT(CUENTA,2), 'CUENTAS_TMP')) AS GRUPO_NOMBRE_2:

Return The value in the field CUEN_NOMBRE From the table CUENTAS_TMP Where the value Left(CUENTA,2) (first 2 characters) match in the field CUENTA_AUX

View solution in original post

4 Replies
alexandros17
Partner - Champion III
Partner - Champion III

IF(LEN(CUENTA)>2,lookup('CUEN_NOMBRE', 'CUENTA_AUX',LEFT(CUENTA,2), 'CUENTAS_TMP')) AS GRUPO_NOMBRE_2:

Return The value in the field CUEN_NOMBRE From the table CUENTAS_TMP Where the value Left(CUENTA,2) (first 2 characters) match in the field CUENTA_AUX

Not applicable
Author

Thank you! Now i have a little doubt about this parte.

Where the value Left(CUENTA,2) (first 2 characters) match in the field CUENTA_AUX

What do you mean with match? that there are the same values? sory but i don´t have a good english

Cheers.

alexandros17
Partner - Champion III
Partner - Champion III

Yes , the first time they have the same values you have the field returned.

Not applicable
Author

Thanks