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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Defining SET is not working in For each loop??

Hi,

I have script like this and it is working fine, but when I use set like this SET i='A-01','B-01','C-01'; I understand that if I use - it is not working, but when I remove - it works fine. I don't want to change the 'A-01' as my source file is coming like that, so don't want to modify that, Is qlikview behaves like or is there any alternative solution.

SET i = 'A','B','C';
// SET i = 'A-01','B-01','C-01'; NOT WORKING
for each m in $(i);
LOAD [Sr No],
     
[Prod ID],
     
[Prod Name],
     
Month
FROM
D:\Project\Testing.xlsx
(
ooxml, embedded labels, table is $(m));
next

1 Solution

Accepted Solutions
maxgro
MVP
MVP

add quotes

//SET i = 'A','B','C';

SET i = 'A-01','B-01','C-01'; //NOT WORKING

for each m in $(i);

LOAD

*

//[Sr No],

//      [Prod ID],

//      [Prod Name],

//      Month

FROM

a.xlsx

(ooxml, embedded labels, table is '$(m)');

next

View solution in original post

2 Replies
maxgro
MVP
MVP

add quotes

//SET i = 'A','B','C';

SET i = 'A-01','B-01','C-01'; //NOT WORKING

for each m in $(i);

LOAD

*

//[Sr No],

//      [Prod ID],

//      [Prod Name],

//      Month

FROM

a.xlsx

(ooxml, embedded labels, table is '$(m)');

next

Not applicable
Author

Worked like charm . Thank you