Reputation: 359
I am working on SSRS 2008 for creating a simple list report. I created a Calculated field which results in two values either New or Renewal for rows.
=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
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. Can anyone please suggest an appropriate coding for my requirement?
Upvotes: 0
Views: 110
Reputation: 361
NULL is not the same as an empty string. NULL is an unknown value thus cannot be evaluated.
Try:
=IIF(
(Fields!New_Renew.Value = "Renewal" AND IsDate(Fields!MaturityDate.Value))
OR Fields!New_Renew.Value = "New",
cdbl(1),
cdbl(0)
)
Upvotes: 2