Discussion Board for collaboration on QlikView Scripting.
i'm trying to use a variable table name into the Drop Table instruction and that seems to not work as intended.
Indeed, i'm working with tables generated according to variable names like :
FOR EACH vInputFile In FileList('.\INPUTS\*')
LOAD * FROM InputFile;
STORE $(currenttablename)$(tablesuffix) INTO '.\STORE\$(currenttablename)';
And after that, i have to purge memory :
FOR iTableNo = 0 to NoOfTables()-1
Let CurrentTable = TableName('$(iTableNo)');
IF WildMatch(CurrentTable,'*$(tablesuffix)') THEN
Drop Table $(CurrentTable);
My problem is that this statement : Drop Table $(CurrentTable);
The variable table name seems to not be replaced correctly during execution, and QV return and error : "Table unavailable : Drop Table statement"
Is drop table working with variable table name ?
Thanks in advance for your help.
Yes it should work with dollar sign expansion.
Does any of the CurrentTable values has a space in it? If yes, the DROP must be adjusted to:
Drop Table [$(CurrentTable)];