I am new to qlikview and going through videos to learn. I am currently on the ETL section of the video but I want to improve upon what teacher is showing (I think I learn better this way). What we are currently doing is creating an inline load of a table to log the table. How he had us do it is we copied the code, almost identical, after each table to log that table. I wanted to change that in to a sub and then just pass the table name in. I have been able to figure it out 90% of the way but the last little bit is giving me an error. Here is the code:
Sub LogTable( vTableName )
LOAD Max(RowNum) as MaxRowNum
let vDateLoaded = Today();
let vSourceFile = 'eCommerce.' & '$(vTableName)';
let vSourceFileType = 'SQL';
let vRowCount = Peek('MaxRowNum', 0, 'zTemp');
DROP table zTemp;
DROP Field RowNum from [$(vTableName)];
LOAD * INLINE [
SourceFile, SourceFileType, DateLoaded, RowCount
'$(vSourceFile)', '$(vSourceFileType)', '$(vDateLoaded)', '$(vRowCount)'
Load *, RowNo() as RowNum;
SQL SELECT CurrencyKey,
But it keeps telling me it cannot find the table (with no name), so I gather I am passing the variable incorrectly. What am I doing wrong?