【问题标题】:BO Reports: have a formula produce a nullBO报告:有一个公式产生一个空
【发布时间】:2012-04-15 21:06:55
【问题描述】:
我需要一个公式在某些情况下产生一个空值,在其他情况下产生一个数字。然后我将使用数字格式进行相应的呈现。像这样的:
=If(Count([Product Id]) = 1) Then null Else [Amount]
很遗憾,null 不是公认的关键字。我也试过nil 和nothing(抓着稻草)。
如果可能的话?
(Business Objects 12 - Web 编辑器)
【问题讨论】:
标签:
crystal-reports
sap
business-objects
【解决方案1】:
试试=If(Count([Product Id]) <> 1) Then [Amount]
【解决方案2】:
关于输出“null”,我对其他类型使用的技巧之一是使用空公式,并在需要 NULL 时参考公式。
@IsNull
// This formula is here just to represent a NULL -- it has no content
然后在您的其他公式中将此作为结果引用。
@MyRealFormula
If(Count([Product Id]) = 1) Then @IsNull Else [Amount]
我不记得 wx 这适用于 NUMBER,但它有助于其他类型。