Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Count Function In Reporting Services Expand / Collapse
Author
Message
Posted Thursday, February 28, 2013 9:56 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, February 27, 2014 12:20 AM
Points: 244, Visits: 884
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!
Post #1425150
Posted Friday, March 01, 2013 3:38 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, April 10, 2014 10:18 AM
Points: 1,769, Visits: 2,800
Hi, how is it not working - error, wrong count, something else?

Cheers
Gaz
Post #1425419
Posted Friday, March 01, 2013 4:09 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, February 27, 2014 12:20 AM
Points: 244, Visits: 884
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!
Post #1425427
Posted Friday, March 01, 2013 4:21 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, April 10, 2014 10:18 AM
Points: 1,769, Visits: 2,800
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
Post #1425431
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse