Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a table with two columns (Filename and Tablename).
Example: Filename (C:\Users\Sudheep\Desktop\Test data\xyz.xlsx) and Tablename is TmpTable. Similarly, I have 10 records with filename and its corresponding table name.
I need to load all the data from the filename with the tablename in a qlikview application. Can someone help me with this logic?
Thanks
Hi Kartick,
Your Load Script should look something like below:
TableList:
Load * Inline
[
Filename, Tablename
'C:\Users\Sudheep\Desktop\Test data\xyz.xlsx','TmpTable'
];
let noRows = NoOfRows('TableList')-1;
for i=0 to $(noRows)
let a = peek('Filename',$(i),'TableList');
let b = peek('tablename',$(i),'TableList');
LOAD
'$(a)' as FielName,
'$(b)' as TableName,
*
FROM [$(a)]
(ooxml, embedded labels, table is [$(b)]);
next i;
Drop table TableList;
Regards,
JP
Hi Kartick,
Your Load Script should look something like below:
TableList:
Load * Inline
[
Filename, Tablename
'C:\Users\Sudheep\Desktop\Test data\xyz.xlsx','TmpTable'
];
let noRows = NoOfRows('TableList')-1;
for i=0 to $(noRows)
let a = peek('Filename',$(i),'TableList');
let b = peek('tablename',$(i),'TableList');
LOAD
'$(a)' as FielName,
'$(b)' as TableName,
*
FROM [$(a)]
(ooxml, embedded labels, table is [$(b)]);
next i;
Drop table TableList;
Regards,
JP
Hi Jonathan,
Thanks for your reply. I tried out the logic you mentioned as below:
For i = 0 to (NoOfRows('Table2')-1)
let a = Peek('Filename',$(i),'Table2');
let b = Peek('Tablename',$(i),'Table2');
LOAD * from [$(a)]
(ooxml, embedded labels, table is [$(b)]);
next i;
For test purpose alone, i just kept only one record.
I am able to achieve what i need. But in addition to it I am getting something different and the following script error occurred:
LOAD * from
(ooxml, embedded labels, table is [~$Null])
In addition to the file i have input I am getting one additional file named
Something going wrong in the loop and creating an additional wrong file by appending '~$' in front of the original file name.
Please help me on this issue
Thanks
Please ignore my previous reply. I got what the issue is.
Thanks