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

API QUESTION DROP TABLE

Dear all,

I have a qvw file only for reload and execute macros.

After execute all I want to drop all tables.

I have that sub but i don't know how ho drop tables:

Sub Droptables

set doc=ActiveDocument

for i=0 to doc.GetTableCount-1

name = doc.GetTableName(i)

'doc.deletetable(name)

next

end sub



5 Replies
prieper
Master II
Master II

Why don't you do it in the script:

DROP TABLE YourTable;
or
DROP TABLES YourTable1, YourTable2;

HTH
Peter

stephencredmond
Luminary Alumni
Luminary Alumni

Hi,

Not sure you can do this via the API. However, what is stopping you doing it at the end of your script?

Regards,

Stephen

Not applicable
Author

Dear,

after reload, I'm executing a Macro that is doing some export.

After that, I want to clear all the data and save the file.

File is loading from another QVW and it's near 2 Gigs, and I don't want to have all the data on the file because it's reloading every day and i don't need the data.

Best regards.

llauses243
Creator III
Creator III

Hi Jordi ,

If drop all tables the document (.qvw) useful zero only schema

Left macro for clear data & save document , to apply OnClose

Good luck, from Spain, Luis (0034657486722)

Not applicable
Author

Dear Luis,

thanks for your answer but How I can execute macro OnClose (I don't have that option to select on document propierties)

Saludos desde Barcelona.