当我运行此查询时:
//---------- 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
我收到此错误:
语法错误,丢失/错位FROM:将Claims-1存储到 \ XX.XX.XX.XX \报告\权利要求 验证\报告\ Qlikviewvalidation \ QVD \权利要求-1.QVD
我是QlikView的新手。有人可以帮我解决这个问题吗?
答案 0 :(得分:2)
此消息的原因是由于下面的第三行:
for i = 0 to NoOfTables() - 1
LET d = TableName(i);
store $(d) into $(vDataDir)\$(d).QVD;
next
当它尝试使用$(d)评估Claims-1
时,它按字面意思进行,并且QlikView将其解释为减法(即Claims - 1
),因为它没有用方括号括起来。因此,QliKView无法理解操作并失败。
因此,请尝试稍微更改以上内容:
for i = 0 to NoOfTables() - 1
LET d = TableName(i);
store [$(d)] into [$(vDataDir)\$(d).QVD];
next