Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
ioannagr
Creator III
Creator III

Last making QVD step problem

This last step which exports tables to qvds always gives me an error.

For i=0 to NoOfTables()-1
let d=TableName(i);
Drop Table [$(d)] ;
Next;

 

 

why is it that? What am I doing wrong?

1 Solution

Accepted Solutions
marcus_sommer

Yes, after the sub-routine but not with the drop-statement else by calling the routine with something like:

CALL WildcardDropTables ('*-temp')

and you may adjust the routine - removing the wildcard-part or extending it to make the parameter optional or you just adapt the index-adjustments into your origin approach.

- Marcus

View solution in original post

5 Replies
marcus_sommer

Each creation or dropping of a table will change the table-index - therefore the loop must run backwards or you need to adjust the loop-counter. I think the following will be helpful for you:

https://www.qlikviewaddict.com/2014/06/dropping-tables-using-wildcard.html 

- Marcus

ioannagr
Creator III
Creator III
Author

Marcus, I will try this code.

If It doesn't work I will come back with my questions. 😄

Thanks once more, 

Ioanna

ioannagr
Creator III
Creator III
Author

Hey Marcus,

 

do you know if  should , after the sub routine, add the DROP TABLES "*-temp";   statement?

marcus_sommer

Yes, after the sub-routine but not with the drop-statement else by calling the routine with something like:

CALL WildcardDropTables ('*-temp')

and you may adjust the routine - removing the wildcard-part or extending it to make the parameter optional or you just adapt the index-adjustments into your origin approach.

- Marcus

ioannagr
Creator III
Creator III
Author

It seems to be working 🙂 Thanks!