简体   繁体   English

SSRS 2008中的过滤条件

[英]Filtering condition in SSRS 2008

I am working on SSRS 2008 for creating a simple list report. 我正在使用SSRS 2008创建一个简单的列表报告。 I created a Calculated field which results in two values either New or Renewal for rows. 我创建了一个Calculated字段,它为行生成两个值New或Renewal。

=iif (LEFT (Fields!ProductShortName.Value, 5)= "Renew" or LEFT (Fields!ProductShortName.Value, 2)= "TR" or LEFT (Fields!ProductShortName.Value, 2)= "XR" or LEFT (Fields!ProductShortName.Value, 3)= "WOW" or LEFT (Fields!ProductShortName.Value, 3)= "Gra" or LEFT (Fields!ProductShortName.Value, 3)= "CTr" ,"Renewal", "New")

I want to further filter the data by excluding the data where the Value is "Renewal" and MaturityDate is null 我想通过排除Value为“ Renewal”且MaturityDate为null的数据来进一步过滤数据

For that purpose I created another calculated field: 为此,我创建了另一个计算字段:

=iif (Fields!New_Renew.Value = "Renewal" and 
      Fields!MaturityDate.Value <> "" or 
      Fields!New_Renew.Value = "New", cdbl(1),cdbl(0))

And then filter this field by 1. I get a blank report when I run it. 然后将该字段过滤为1。运行该报告时,我得到一个空白报告。 Can anyone please suggest an appropriate coding for my requirement? 谁能根据我的要求建议合适的编码?

NULL is not the same as an empty string. NULL与空字符串不同。 NULL is an unknown value thus cannot be evaluated. NULL是未知值,因此无法评估。

Try: 尝试:

=IIF(
    (Fields!New_Renew.Value = "Renewal" AND IsDate(Fields!MaturityDate.Value))
        OR Fields!New_Renew.Value = "New", 
    cdbl(1),
    cdbl(0)
)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM