none
If Statement Yes, ot No RRS feed

  • Question

  • Hi,

    When using the following expression I get all Yeses unless I put No at the end then it will say no for all rolls.

    How can I get it to say yes if there is data in the field and no if there is no data?

    Using the following expression below. FYI I have also tried using SWITCH and it does not work.

    =IIF(Fields!AVAILABILITY.Value =

    "", "NO","YES")

    Monday, February 11, 2019 5:08 PM

Answers

  • Hi Zoe Zhi,

    Thank You for your help. It was my data. Once I resolved the issue all three solutions work.

    =IIF(Fields!AVAILABILITY.Value = "", "NO","YES")

    =IIF(IsNothing(Fields!AVAILABILITY.Value), "NO", "YES")

    =iif(Fields!status.Value="" or Fields!status.Value is nothing, "no","yes")

    Thank You, bot for your help.

    • Marked as answer by Kimmie25 Tuesday, February 12, 2019 1:12 PM
    Tuesday, February 12, 2019 1:12 PM

All replies

  • =IIF(IsNothing(Fields!AVAILABILITY.Value), "NO", "YES")

    A Fan of SSIS, SSRS and SSAS



    • Edited by Guoxiong Monday, February 11, 2019 5:22 PM
    Monday, February 11, 2019 5:21 PM
  • Thank You for your help. I that same thing still happens. Whichever is last will display. I'm also jetting the following warning.

    Warning :[rsRuntimeErrorInExpression] The Value expression for the textrun ‘AVAILABILITY.Paragraphs[0].TextRuns[0]’ contains an error: Input string was not in a correct format.

    Monday, February 11, 2019 7:32 PM
  • Hi Kimmie25

    You could try to use below expression to see whether it works or not

    =iif(Fields!status.Value="" or Fields!status.Value is nothing, "no","yes")

    In addition, it seems that there is something wrong with data, if possible, could you please inform me your dataset in details?

    Best Regards,
    Zoe Zhi


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, February 12, 2019 1:56 AM
    Moderator
  • Hi Zoe Zhi,

    Thank You for your help. It was my data. Once I resolved the issue all three solutions work.

    =IIF(Fields!AVAILABILITY.Value = "", "NO","YES")

    =IIF(IsNothing(Fields!AVAILABILITY.Value), "NO", "YES")

    =iif(Fields!status.Value="" or Fields!status.Value is nothing, "no","yes")

    Thank You, bot for your help.

    • Marked as answer by Kimmie25 Tuesday, February 12, 2019 1:12 PM
    Tuesday, February 12, 2019 1:12 PM