如何用字符串替换交叉表单元格的值

时间:2015-08-21 12:14:01

标签: crosstab cognos

我有列事实,它可以带有一些不同的值:

 - 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"作为集合函数。

如何用字符串替换我的特殊值?

1 个答案:

答案 0 :(得分:1)

您不需要将价值更改为VAC,SICK等。 您需要更改DISPLAYED值。

  1. 解锁RS中的挂锁。
  2. 选择单元格中的文字
  3. 将文字来源设为"报告表达式"
  4. 写出像
  5. 这样的表达方式
    $data = $_POST['address'];
    foreach($data as $address) {
        //your address-object (name, street, city, phone)
        var_dump($address);
        //Add your sql-query in here and DO NOT forget to escape your received data
    }
    
相关问题