Count Function In Reporting Services

  • Dear All,

    I'm trying to do a simple query where I want to count a Column with a Dataset but its not working for some reason. I'm using the following query:

    Count(Fields!columnname.Value, "Dataset1")

    Thank you in advance!

  • Hi, how is it not working - error, wrong count, something else?

    Cheers

    Gaz

  • Gazareth (3/1/2013)


    Hi, how is it not working - error, wrong count, something else?

    Cheers

    Gaz

    Thank you for your reply!

    I now changed the expression to =CountDistinct(Fields!columnname.Value) but I get the following results:

    Year Count %Var

    2000 1

    1

    2001 1

    1

    1

    1

    2002 1

    1

    1

    1

    1

    1

    But I need the total per year to be added together.

    Thank you!

  • Hi, yeah CountDistinct will do that, if every value in the column is the same, which it looks like it is (year?).

    One solution would be to change the column in your expression to one that's unique in every row, and that you can guarantee it always will (else future counts could be wrong), or go back to using just Count - still not sure what was wrong with that first time around 🙂

    Cherrs

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

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