Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I hope someone can help me, there are many files and tables in my document. So I have made an excelfile where the tables or filenames which I want to delete get the flag 0 (Zero). I made a little script, it runs but the table is not deleted/dropped.
for Testing I have one table in my excelfile with flag 0 called SalesInvoice,
/*
Load ExcelFile DropTablesFields
if Flag = 0 then Drop Table
*/
DropTables:
LOAD
A as TableName,
B as Flag
FROM
(ooxml, no labels, header is 1 lines, table is Tabelle1);
// where = 0;
IF = 0 THEN
Set vTableName = A;
DROP Table $( vTableName);
DROP TABLE A;
ENDIF
Perhaps someone can tell where my thinking went wrong.
I'm also open for a control if the table I want to drop, exists in my document.
Regards,
Court
Maye be like this:
DropTables:
LOAD
A as TableName,
B as Flag
FROM
(ooxml, no labels, header is 1 lines, table is Tabelle1)
Where B = 0;
For i = 0 to FieldValueCount(TableName)
LET TableName = FieldValue('TableName', $(i));
DROP Table $(TableName);
NEXT i
Thanks for your reply,
I will test it tomorrow