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

How to you add summary (count) expressions for fields in a table report? Expand / Collapse
Author
Message
Posted Friday, January 21, 2011 11:43 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, August 12, 2014 2:48 PM
Points: 268, Visits: 769
Hello,

I am using SQL Server SSRS 2008. I am trying to migrate a report form Crystal Reports to SSRS.

I have a table report.

I've added three groups.

Group 1 - Store location

Group 2 - Employee Name

Group 3 - First Day of the Week (groups data by week and then shows the first day of the week.

Data fields
Employeename PatronName Date Product Sold


I want to show the number of each employee for each week for each location.

In crystal reports, I would right click on the field in the detail region and insert summary and change the summary to count. I then select which group the summary is for.

How do I do this in SSRS? With a table report, how would I add a summary total report to each group.


For example, I need something like the following:

Group 3
Employeename PatronName Date Product Sold

group 3 footer ="Total Products sold by " & {employeename} & "is: " & count(products_sold),employeename")



Post #1051741
Posted Friday, January 21, 2011 2:05 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, January 30, 2014 2:09 PM
Points: 29, Visits: 135
Did you look at adding row groups to your datatable (right click on the far left of the row | Add Row). With this, you can then add rows within your group and in these added rows you can do sums for any of the columns in the group.
Post #1051831
Posted Friday, January 21, 2011 2:15 PM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, August 12, 2014 2:48 PM
Points: 268, Visits: 769
Hi,

Yes I did do that. I wasn't sure if that was the right way or not.

However, I am not sure how to write the summary expression to give me the total count for each group.

The expression that I wrote seems high and probably report wide instead of the current group.

Thanks for responding. That really helps to get advice from those that have been using the product awhile.

Tony



Post #1051838
Posted Friday, January 21, 2011 3:44 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, January 30, 2014 2:09 PM
Points: 29, Visits: 135
This is what you are trying to duplicate:

group 3 footer ="Total Products sold by " & {employeename} & "is: " & count(products_sold),employeename")


you could do something like this:

="Total Products sold by " + Fields!employeename.Value + " is: " + Count(Fields!products_sold.Value)
Post #1051880
Posted Tuesday, January 25, 2011 2:22 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, January 29, 2011 9:09 PM
Points: 4, Visits: 3
Would it not be easier to add a count* to your query? select employe, count(*) as emp_total from emp_table left join location table group by employee? I am writing an ssrs blog. Please visit it and give me some suggestion.
http://ssrsdeveloper.blogspot.com/
Post #1053532
Posted Tuesday, January 25, 2011 3:19 PM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, August 12, 2014 2:48 PM
Points: 268, Visits: 769
Hi,

If I need to create another table I can. But that, to me, defeats the purpose of having a report building product.

It is not easier, I don't believe, to add a query and then an inner join.

In Crystal Reports, I right click on the field and hit summary and then count. I'm done.

I was thinking I could do that in SSRS. You probably can, it's just that I don't know the product well enough.

Thanks.



Post #1053566
Posted Tuesday, January 25, 2011 3:23 PM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, August 12, 2014 2:48 PM
Points: 268, Visits: 769
jamey8420 (1/21/2011)
This is what you are trying to duplicate:

group 3 footer ="Total Products sold by " & {employeename} & "is: " & count(products_sold),employeename")


you could do something like this:

="Total Products sold by " + Fields!employeename.Value + " is: " + Count(Fields!products_sold.Value)


HI Jamey,

Thanks for responding.

I thought that also. But in Group footer 3, I want to count the number of rows in group footer 3 not report wide. I think, from looking at the numbers, Count(Fields!products_sold.Value) gives me a count of the field!products_sold) for the report and not just a count summary expression for the records that appear in group 3.

Thanks again.



Post #1053569
Posted Thursday, January 27, 2011 4:08 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, August 12, 2014 2:48 PM
Points: 268, Visits: 769
Jamey,

I finally got it to work. In running the wizard, it produced a report that had the group row. I put the formula in that you suggested and it worked!!

Thanks for the help.

I understand the process now. I'm off and running.


Tony



Post #1054466
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse