Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Friends,
I have a scenario to concatenate the QVDs present in two folders and store them in a new folder. Both folders have some set of same QVDs with different structures. Those will be concatenated easily. No Problem. But the QVDs that are present in one folder but not in other folder and vice-versa, are not being stored in the destination folder. "Table Not Found" error arises. I really need to store these uncommon QVDs as well in the concatenated folder. How to deal with this scenario? Any IF...ELSE Condition required? Please revise the code below:
let qvdpath = 'C:\Users\XYZ\Desktop';
for each qvd_file in FileList('$(qvdpath)\MAP\*')
let QVDName = subfield('$(qvd_file)','\',6);
$(QVDName):
load
*
FROM
$(qvdpath)\MAP\$(QVDName)
(qvd);
next
for each qvd_file in FileList('$(qvdpath)\HPG\*')
let QVDName = subfield('$(qvd_file)','\',6);
Concatenate($(QVDName))
load
*
FROM
$(qvdpath)\HPG\$(QVDName)
(qvd);
store $(QVDName) into C:\Users\XYZ\Desktop\Test QVDs\$(QVDName);
drop Tables $(QVDName);
next
EXIT Script ;
Hi
I didn't realise that TableName() is zero based until I looked at your error.
Change the last part of the script:
For z = 0 to NoOfTables() - 1
Let vTableName = TableName(z);
Let vOutfile = vTableName & '.qvd';
STORE [$(vTableName)] INTO [$(qvdpath)\Test QVDs\$(vOutfile)] (qvd);
Drop Table [$(vTableName)];
Next
I think that should solve the problem.
Regards
Jonathan
Jason
Hi Jonathan, got a solution. Thanks to Rob for that. Probably the DROP command was creating the problems.
Changed the script to FOR i = NoOfTables()-1 to 0 step -1.
Working fine now. Thanks a lot for your help.
Regards.
Hi Jonathan/Jason,
Can you please help me too in the post in this link?
http://community.qlik.com/message/303936#303936
Regards.