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

  • 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")

    Things will work out.  Get back up, change some parameters and recode.

  • 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.

  • 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

    Things will work out.  Get back up, change some parameters and recode.

  • 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)

  • 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/

  • 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.

    Things will work out.  Get back up, change some parameters and recode.

  • 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.

    Things will work out.  Get back up, change some parameters and recode.

  • 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

    Things will work out.  Get back up, change some parameters and recode.

Viewing 8 posts - 1 through 7 (of 7 total)

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