0

我确定这是相当不寻常的情况,我似乎无法找到解决方案。

我正在尝试报告 SQL DB 表;该表有一个名为 sample_bucket 的字段,它定义了用作样本的大小,在这个表中我们有 size01-size24 列。此外,我们还有另一个名为“类型”的字段,我需要在类型 A 和 B 之间进行选择。

我在两个“公式字段”上使用了以下代码来根据 sample_bucket 的内容提取 sizeXX,如下所示:

公式1:

if {zzpom.Type}= "A" and {zzpom.SAMPLE_BK}=1 then {zzpom.SIZE01}
else
if {zzpom.Type}= "A" and {zzpom.SAMPLE_BK}=2 then {zzpom.SIZE02}
else
.
.
if {zzpom.Type}= "A" and {zzpom.SAMPLE_BK}=24 then {zzpom.SIZE24}
else 0

并且

公式2:

if {zzpom.Type}= "B" and {zzpom.SAMPLE_BK}=1 then {zzpom.SIZE01}
else
if {zzpom.Type}= "B" and {zzpom.SAMPLE_BK}=2 then {zzpom.SIZE02}
else
.
.
if {zzpom.Type}= "B" and {zzpom.SAMPLE_BK}=24 then {zzpom.SIZE24}
else 0

我过滤了,{formula1}<>0 or {formula2}<>0但是当我运行报告时,我得到两列而不是一列:

公式1 公式2 | 公式1 公式2  
  6.5 0 | 0 12

我试图总结报告,但看起来 CR 在传播中运行这些公式!

我需要将这两列合并到:

公式1 公式2  
  6.5 12

任何帮助将不胜感激!

4

1 回答 1

1

如果这是在 CR 内,那么我猜这些公式位于单独的公式字段中。我会将公式合并到一个字段中。

if ({zzpom.Type}= "A" or {zzpom.Type}= "B") and {zzpom.SAMPLE_BK}=1 then {zzpom.SIZE01}
else if ({zzpom.Type}= "A" or {zzpom.Type}= "B") and {zzpom.SAMPLE_BK}=2 then {zzpom.SIZE02}
于 2012-09-18T02:18:26.000 回答