DistinctCount and IIF

  • Hi,

    I am trying to get a distinct count of records that have the value of "yes" in particular field. The field in particular can have a yes or no value. I tried to do distinctcount(fields!Comp.value) of records but it does not giving me the number of records with the "yes" value correctly.

    I also tried =distinctcount(iif(fields!Comp.value ="yes",)

    For example

    RowID Comp

    1 no

    2 yes

    3 no

    4 yes

    5 no

    Yes Total 2

    Any assistance is appreciated.

  • Create a named calculation in your dsv

    case Comp when 'yes' then 1 else 0 end

    and create a regular measure on this named calculation with SUM as aggregate function.

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

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