【问题标题】:Using Iff and Sum SSRS使用 IFF 和 Sum SSRS
【发布时间】:2014-04-28 23:34:10
【问题描述】:

我正在努力处理我的表达我正在尝试删除 WebSoldPriceForFmvRatioLastFMV 的任何值,这些值将使 isPriorMonthAppraised 值为零。我尝试了几次尝试结合使用 iif 和 sum 语句,但它们都返回错误。我是否正确使用了 IFF 语句,还是需要使用另一个条件语句? 代码:

   =Code.Divide(SUM(
                   IIF(
                       Fields!isPriorMonthAppraised.Value=0
                      ,Fields!WebSoldPriceForFmvRatio.Value,0))
               , SUM(
                   IIF(Fields!isPriorMonthAppraised.Value=0
               ,Fields!LastFMV.Value,0)))

【问题讨论】:

  • 你能把实际的代码示例粘贴到这里吗?没有“IFF”声明。您的意思必须是“IIF”。
  • 在这种情况下,“价值尚未发出”是什么意思?
  • @MarkBertenshaw 我的解释很糟糕我正在尝试删除 LastFMV 的任何值,因为 isPriorMonthAppraised 的值为零。
  • 你遇到了什么错误?
  • 返回此错误:Error 2 [rsFieldReference] The Value expression for the text box ‘Textbox39’ refers to the field ‘WebSoldPriceForFmvRatio’. Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope. Letters in the names of fields must use the correct case.

标签: visual-studio-2012 reporting-services expression


【解决方案1】:
  1. 您的WebSoldPriceForFmvRatio 与您的表格/矩阵的数据集 不在同一数据集

    如果您需要从不同的数据集访问它,您需要使用聚合函数查找函数重新设计数据集

  2. 还请记住,字段名称区分大小写。它必须与数据集下的字段名称匹配。

    WebSoldPriceForFmvRatio 不同于 WebSoldPriceForFmvRatiOWEBSoldPriceForFMVRatio

【讨论】:

    【解决方案2】:

    我相信正确的拼写是“IIF”,而不是“IFF”,所以也许从那里开始。

    此外,您是否期望 0(如数字 0),还是需要测试 NULL 值?如果需要测试 NULL,请使用 IsNothing() 函数。

    【讨论】:

    • 它正在测试数字 0。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-11-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多