【发布时间】:2015-11-15 09:13:51
【问题描述】:
我有列事实,它可以携带一些差异值:
- Positive values - real values, need to be outputted as is
- 0 is null, output as is
- -1 - special value. Need to ouput "VAC" string in cell.
- -2 - special value. Need to output "SICK" string in cell.
我试图用编辑尺寸来做,我用:
case
when [BaseEmp].[FACT_VALUE] = -1 then 'VAC'
when [BaseEmp].[FACT_VALUE] = -2 then 'SICK'
else to_char([BaseEmp].[FACT_VALUE])
end
但现在我看到错误:ORA-01722 无效数字(我认为,因为无法聚合字符串)。在列属性中,我选择“min”作为聚合函数。
如何用字符串替换我的特殊值?
【问题讨论】:
-
更多关于你真正想要的例子会很有帮助。您想在聚合之后更改值吗?您可能需要使用子查询来获得所需的结果,然后将该结果集用于您的交叉表。
-
我想在聚合后替换值(因为它不能聚合字符串)。我修改查询以获取字符串,但交叉表无法输出字符串。