Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
New 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
Highlighted
Partner
Partner

Re: Join between Excel and ORACLE

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...

Plees ekskuse my Swenglish and or Norweglish spelling misstakes

View solution in original post

1 Reply
Highlighted
Partner
Partner

Re: Join between Excel and ORACLE

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...

Plees ekskuse my Swenglish and or Norweglish spelling misstakes

View solution in original post