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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Xolink1389
Creator
Creator

HELP WITH FOR EACH

Hello i have an issue with this for each, im trying to load 3 tables, 1,2,3,

Set vTablas = 'Tabla1', 'Tabla2', 'Tabla3';


FOR  each name in '$(vTablas)'
let vTablaname = Peek('$(vTablas)', '$(name)');
    '$(vTablaname)':
    NoConcatenate
    LOAD *
    INLINE [
        ID, Nombre
        1, Juan
        2, María
    ];
NEXT name

 

but i only get this, please help, i want 3 tables, table1 table2 and table3 

Xolink1389_0-1712955376912.png

 

 

Labels (4)
1 Solution

Accepted Solutions
Xolink1389
Creator
Creator
Author

i found the solution 
i was puting my variable with in ' ' so like, i just put $(vTablas) with no ' ' and it fix the problems

SET vTablas = 'ADCP', 'ADR6', 'ADRP', 'AGR_1016', 'AGR_1251', 'AGR_DEFINE', 'AGR_PROF', 'AGR_TEXTS', 'AGR_USERS', 'T024', 'T16FB', 'T16FE', 'T16FG', 'T16FS', 'T16FT', 'T16FW', 'T16FH';
FOR  each i in $(vTablas)  
    '$(i)':
    NoConcatenate
    LOAD * Where RecNo() = 1;
    SQL SELECT * FROM $(i) ;
NEXT i



now i have all my tables 

Xolink1389_0-1712959642001.png

 



 

View solution in original post

1 Reply
Xolink1389
Creator
Creator
Author

i found the solution 
i was puting my variable with in ' ' so like, i just put $(vTablas) with no ' ' and it fix the problems

SET vTablas = 'ADCP', 'ADR6', 'ADRP', 'AGR_1016', 'AGR_1251', 'AGR_DEFINE', 'AGR_PROF', 'AGR_TEXTS', 'AGR_USERS', 'T024', 'T16FB', 'T16FE', 'T16FG', 'T16FS', 'T16FT', 'T16FW', 'T16FH';
FOR  each i in $(vTablas)  
    '$(i)':
    NoConcatenate
    LOAD * Where RecNo() = 1;
    SQL SELECT * FROM $(i) ;
NEXT i



now i have all my tables 

Xolink1389_0-1712959642001.png