Reputation: 8488
When I run this query:
//---------- Load Claims data ----------
//Let ClaimsPath = '..\..\..\ConsCare\Claims\*.XLSX';
Let ClaimsPath = '\\xx.xx.xx.xx\reports\Claim validation\reporting\Claim files\*.XLSX';
for each File in filelist (ClaimsPath)
Claims:
LOAD
Date(FileTime()) as [Reporting Date],
FileName() as [Source_File_Claim],
*
FROM $(File)
(ooxml, embedded labels, table is Data);
next File
//---------- Store and Drop Table ----------
for i = 0 to NoOfTables() - 1
LET d = TableName(i);
store $(d) into $(vDataDir)\$(d).QVD;
next
LET j = NoOfTables();
do while j > 0
let d = TableName(0);
drop table $(d);
let j = NoOfTables();
loop
I get this error:
Syntax error, missing/misplaced FROM: store Claims-1 into \xx.xx.xx.xx\reports\Claim validation\reporting\Qlikviewvalidation\QVD\Claims-1.QVD
I am a newbie to QlikView. Can someone please help me to fix this?
Upvotes: 0
Views: 1531
Reputation: 3506
The reason for this message is because of third line in the below:
for i = 0 to NoOfTables() - 1
LET d = TableName(i);
store $(d) into $(vDataDir)\$(d).QVD;
next
When it tries to evaluate Claims-1
using $(d), it does so literally and QlikView interprets it as a subtraction (i.e. Claims - 1
) because it is not enclosed in square brackets. As a result QliKView does not understand the operation and fails.
Therefore, please try changing the above slightly to:
for i = 0 to NoOfTables() - 1
LET d = TableName(i);
store [$(d)] into [$(vDataDir)\$(d).QVD];
next
Upvotes: 2