在QLikSense服务器脚本中加载文件时,文件路径中出现意外令牌

时间:2018-08-30 14:52:42

标签: filepath qliksense

我试图将QLikView应用程序转换为QlikSense服务器应用程序。我的第一步是将脚本传输到QlikSense服务器。

SET vHide = 1;
SET vExcelPath = [lib://Finance (hilltops_sa_carapax)/];
LET vToday = NUM(TODAY());

我的文件路径由vExcelPath定义

在以类似路径的硬编码方式加载文件时:

   LOAD
        @1,
        @2,
        @3,
        @4
    FROM [lib://Finance (hilltops_sa_carapax)/2018-22.csv]
    (txt, codepage is 1252, no labels, delimiter is ';', msq);

它正常工作。

我目前有13个名为2018-22的文件,直到2018-34,我想使用以下LOAD语句加载所有这些文件:

PreLoad:
LOAD
ROWNO() AS PL_LineNo,
@1 AS PL_1,
@2 AS PL_2,
21 + CEIL(ROWNO() / 6 - 0.1)
AS PL_Week,
@3 AS PL_3,
@4 AS PL_4,
@5 AS PL_5,
@6 AS PL_6
FROM $(vExcelPath)2018-*.csv
(txt, codepage is 1252, no labels, delimiter is ';', msq)
WHERE LEN(TRIM(@2))>0;

我收到的错误是:

Laden van gegevens gestart

De volgende fout is opgetreden:

Unexpected token: 'hilltops_sa_carapax', expected one of: 'html', 'Header', 'biff', 'dif', 'fix', 'json', 'kml', ...

De fout is hier opgetreden:

PreLoad: LOAD ROWNO() AS PL_LineNo, @1 AS PL_1, @2 AS PL_2, 21 + CEIL(ROWNO() / 6 - 0.1) AS PL_Week, @3 AS PL_3, @4 AS PL_4, @5 AS PL_5, @6 AS PL_6 FROM lib://Finance (>>>>>>hilltops_sa_carapax<<<<<<)/2018-*.csv (txt, codepage is 1252, no labels, delimiter is ';', msq) WHERE LEN(TRIM(@2))>0

Gegevens zijn niet geladen. Corrigeer de fout en probeer opnieuw te laden.

我试图重命名与ExcelFiles的连接,但是QLikSense会自动将其更改为ExcelFiles(hilltops_sa_carapax)。我认为该错误是由空格和/或括号引起的,但在编辑连接时无法删除此字符。

我也尝试过重命名为ExcelFiles_(hilltops_sa_carapax),但这会自动更改为ExcelFiles_(hilltops_sa_carapax)(hilltops_sa_carapax)。

我该如何解决?

0 个答案:

没有答案