Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
shark33333
Contributor
Contributor

Join between Excel and ORACLE

Hello

    I need your help with the following issue: I have to use an excel field in a sql where sentence.

   That's what I'm doing:

   DIM_TARGET_COM_AUX:
LOAD @1 as ID_EXT_AUX,
            @3 as PACK_ID_AUX,
            @5 as CUSTCODE_AUX,
            @7 as MSISDN_FECHA_AUX
FROM
[C:\Users\S231660\Desktop\TARGET\asignacion_auto_promo_*.dat]
(txt, utf8, no labels, delimiter is ';', msq);

[SUM_COM]: LOAD concat(CHR(39) & CUSTCODE_AUX & CHR(39) ,',') AS CUSTCODE_LIST Resident DIM_TARGET_COM_AUX;

LET v_custcode = CUSTCODE_LIST;

CUSTOMER_ALL:
LOAD
CUSTOMER_ID;
SQL SELECT CUSTOMER_ID
FROM CUSTOMER_ALL
WHERE CUSTCODE in ( $(v_custcode) );

The problem is that at execution time I got an error saying that v_custode is empty, but in the SUM_COM table the field CUSTCODE_LIST is populated.

Can you help me on this? do you know a better way to do it?

Thanks a lot for your help.

1 Solution

Accepted Solutions
Vegar
MVP
MVP

You are not declaring v_custcode correctly.

Try this:

LET v_custcode = peek('CUSTCODE_LIST', -1, 'SUM_COM');

 

https://help.qlik.com/en-US/sense/June2019/Subsystems/Hub/Content/Sense_Hub/Scripting/InterRecordFun...

View solution in original post

1 Reply
Vegar
MVP
MVP

You are not declaring v_custcode correctly.

Try this:

LET v_custcode = peek('CUSTCODE_LIST', -1, 'SUM_COM');

 

https://help.qlik.com/en-US/sense/June2019/Subsystems/Hub/Content/Sense_Hub/Scripting/InterRecordFun...