Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
lakshmanvepuri
Creator
Creator

Exclusion List should take from Excel for LOAD Script

Hi All,

This is the code...used in the SCRIPT

INC:
LOAD
CUST_NAME,
POT_VAR,
STEP_ITEM,
DAM_NAME,
CAN_ID,
M_ID,
POL_NAME
FROM
[D:\Users\LL4356\INC.qvd](qvd)
WHERE

MATCH(POT_VAR,'ListShould Take from Excel') AND
NOT MATCH(CUST_NAME,'ListShould Take from Excel') AND
CAN_ID <> 'ListShould Take from Excel' AND
NOT WILDMATCH(POL_NAME,'ListShould Take from Excel');

Exclusion List is not constant and will be controlled by the User. 

Please check the Excel and let me know how to use in the LOAD SCRIPT.

 

Thanks

Vepuri LK

Labels (2)
1 Solution

Accepted Solutions
MayilVahanan

HI @lakshmanvepuri 

Try like below

LOAD chr(39)&Concat(CUST_NAME, chr(39)&','&chr(39))&chr(39) as CustName,
chr(39)&Concat(POT_VAR, chr(39)&','&chr(39))&chr(39) as PotVar,
chr(39)&Concat(CAN_ID, chr(39)&','&chr(39))&chr(39) as CanId,
chr(39)&Concat(POL_NAME, chr(39)&','&chr(39))&chr(39) as PolName
FROM
[D:\Qlik\personnal\List.xlsx]
(ooxml, embedded labels, table is ExclusionList);

Let vCustName = Peek('CustName');
Let vPotVar = Peek('PotVar');
Let vCanId = Peek('CanId');
Let vPolName = Peek('PolName');

Load * from yoursource where MATCH(POT_VAR,$(vPotVar)) AND
NOT MATCH(CUST_NAME,$(vCustName)) AND
CAN_ID <> $(vCanId) AND
NOT WILDMATCH(POL_NAME,$(vPolName));

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

1 Reply
MayilVahanan

HI @lakshmanvepuri 

Try like below

LOAD chr(39)&Concat(CUST_NAME, chr(39)&','&chr(39))&chr(39) as CustName,
chr(39)&Concat(POT_VAR, chr(39)&','&chr(39))&chr(39) as PotVar,
chr(39)&Concat(CAN_ID, chr(39)&','&chr(39))&chr(39) as CanId,
chr(39)&Concat(POL_NAME, chr(39)&','&chr(39))&chr(39) as PolName
FROM
[D:\Qlik\personnal\List.xlsx]
(ooxml, embedded labels, table is ExclusionList);

Let vCustName = Peek('CustName');
Let vPotVar = Peek('PotVar');
Let vCanId = Peek('CanId');
Let vPolName = Peek('PolName');

Load * from yoursource where MATCH(POT_VAR,$(vPotVar)) AND
NOT MATCH(CUST_NAME,$(vCustName)) AND
CAN_ID <> $(vCanId) AND
NOT WILDMATCH(POL_NAME,$(vPolName));

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.