Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to you add summary (count) expressions for fields in a table report?


How to you add summary (count) expressions for fields in a table report?

Author
Message
WebTechie
WebTechie
SSC Veteran
SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)

Group: General Forum Members
Points: 295 Visits: 917
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")



jamey8420
jamey8420
SSC Rookie
SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)

Group: General Forum Members
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.
WebTechie
WebTechie
SSC Veteran
SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)

Group: General Forum Members
Points: 295 Visits: 917
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



jamey8420
jamey8420
SSC Rookie
SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)

Group: General Forum Members
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)
chanluongbus
chanluongbus
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
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/
WebTechie
WebTechie
SSC Veteran
SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)

Group: General Forum Members
Points: 295 Visits: 917
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.



WebTechie
WebTechie
SSC Veteran
SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)

Group: General Forum Members
Points: 295 Visits: 917
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.



WebTechie
WebTechie
SSC Veteran
SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)

Group: General Forum Members
Points: 295 Visits: 917
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



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search