Search code examples
sql-serverreporting-servicesssrs-2008-r2ssrs-tablix

Count value in SSRS


I want to ask a question regarding the count error that is generated in SSRS reporting server. I have two condition simultaneously, but the count is working only for one condition not for both. Please suggest is there any problem in my logic or anyone have any better idea to count both condition.

enter image description here


Solution

  • The Switch function takes pairs of conditions and results. It looks like you gave it just two conditions. So basically it's counting a boolean when the second condition is true.

    It sounds like you want to count cases where that column has either value. In this case you could write the statement like this:

    =Count(IIf(Fields!IPMS_SETUP_13.Value = 1 OR Fields!IPMS_SETUP_13.Value = 2, 1, Nothing))
    

    In other words, if the column has either value, count it, otherwise do nothing.