Working with conditionals + IIF

  • I need an iif conditional like this:

    =iif(fields!carrier.ismissing, " ", "carrier name is "(fields!carrier.value))

    in this example if the field carrier is missing or is nothing then nothing is returned; otherwise the text "carrier name is " and "the field value is returned.

    I also need something like this:

    =IIF(Fields!carrier.Value Is Nothing," Nothing", IIF(Fields!carrier.Value like "%Sprint%","Sprint/Nextel",Fields!carrier.Value))

  • Try something like this:

    iif(isnothing(Fields!carrier.Value),"","Carrier Name is: " & Fields!Carrier.Value)

    and for the second one:

    iif(isnothing(Fields!Carrier.Value),"Nothing",IIF(Fields!carrier.Value like "%Sprint%","Sprint/Nextel",Fields!carrier.Value))

  • Thx for responding, I asked around and solved the issue, here is the solution; also learned that wildcards in SSRS is an asterick not a % like "joe*" not "joe%".

    =IIF(Fields!carrier.Value = "","","- carrier name is " & iif(Fields!carrier.Value like "carrier1*" or Fields!carrier.Value like "carrier2*" or Fields!carrier.Value like "CARRIER3*" or Fields!carrier.Value like "Carrier4*","UniqueCarrier",Fields!carrier.Value)).

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply