是"加载" Qlikview中的声明不允许在一个字段上进行多个顺序操作?

时间:2018-05-17 09:44:42

标签: data-visualization qlikview qliksense

我想保留字段名:Country,Cal_Year和Cal_Month。但是,如果我尝试运行代码,则代码将无法运行,如下面的示例代码所示。 错误状态:'国家/地区'不是有效的字段名称。

LOAD [Country Code], 
         [ISO code], 
         Currency,
         ApplyMap('Currency_Map',Currency, 'Currency Unmapped') as Country, 
         Quotation, 
         year as Cal_Year, 
         trim(mid(period, 3,4)) as Cal_Month, 
         Balance, 
         Activity,
         (Balance/Quotation) as FX_Rate,
         Country & Cal_Year & Cal_Month as Key1   <-supposedly an erroneous statement

2 个答案:

答案 0 :(得分:1)

你缺少逗号吗?

(Balance/Quotation) as FX_Rate,  <-- missing comma here
Country & Cal_Year & Cal_Month as Key1

答案 1 :(得分:1)

另外,这样做只能引用原始数据表,而不是结果。所以你需要

Country & Cal_Year & Cal_Month as Key1

成为

ApplyMap('Currency_Map',Currency, 'Currency Unmapped')
& year
& trim(mid(period, 3,4)) as Key

在添加逗号后也能正常工作