Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Peony
Creator III
Creator III

Store and drop tables in a loop

Hi All.

Here I have some issue with store and drop process in a loop. 

I have several tables in a load script and want to store and drop them using  a loop. Like below.

Answer:
LOAD *
FROM Answer;

Question:
LOAD *
FROM Question;

Set vTransformFinal = '[QVD\Transform\Full\';

let vTables = NoOfTables();

Let i = 0;

Do While i < vTables

Let vTable = TableName(i);

Store $(vTable) into $(vTransformFinal)$(vTable).qvd];
Drop Table $(vTable);

i = i+1;

Loop;

But for some reason after first iteration I received such error:

error.png

But I see that QVD for Answer table  was stored even after I get this error. But table can't be dropped. 

error2.png 

After this message script failed. 

Could you please help me to find what  am I doing  wrong  with my code and how to fix it?

1 Solution

Accepted Solutions
Peony
Creator III
Creator III
Author

Solved! Should be  Let vTable = TableName(0);

View solution in original post

1 Reply
Peony
Creator III
Creator III
Author

Solved! Should be  Let vTable = TableName(0);