Spotfire 在加载前转换文本值

Spotfire to transform text value before loading

各位,

我的 [A] 列包含各种文本,需要在加载前转换该文本(即替换为缩写)。

因此,table 具有以下值:J1、J2、J3、PLAB、CIVIL、ENGG 等。

我需要将其转换为 "J1" 到 "Java"、"J2" 到 "Stack",同时保持 PLAB、CIVIL 和 ENGG 的原样。

希望我清楚。

PS: 我不需要计算列,因为 [A] 列有其他不需要转换的文本。

当您将数据 table 添加到分析时可以完成此操作。

  • 文件 > 添加数据 Table >(Select 你的数据)
  • 在 window 的底部,您将看到 Transformations... select Calculate and replace column
  • 添加下面的表达式,并为其指定与原始列相同的列名
  • Select 好的

自定义表达式:

case
   when [yourColumn] = 'J1' then 'Java'
   when [yourColumn] = 'J2' then 'Stack'
   else [yourColumn]
end