SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to sum an aggregate expression


How to sum an aggregate expression

Author
Message
NineIron
NineIron
SSCertifiable
SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)

Group: General Forum Members
Points: 5611 Visits: 767

I have a subreport grouped by EdStatusName. The subreport is counting the number of patients in each status. I would like to add a Grand Total. The expression for the EdStatusName count is =Count(Fields!EdStatusName.Value). I inserted a row outside the group but, can't get the correct Sum. Any thoughts?





sgmunson
sgmunson
SSC-Forever
SSC-Forever (43K reputation)SSC-Forever (43K reputation)SSC-Forever (43K reputation)SSC-Forever (43K reputation)SSC-Forever (43K reputation)SSC-Forever (43K reputation)SSC-Forever (43K reputation)SSC-Forever (43K reputation)

Group: General Forum Members
Points: 43618 Visits: 5422
NineIron - Friday, June 30, 2017 7:31 AM


I have a subreport grouped by EdStatusName. The subreport is counting the number of patients in each status. I would like to add a Grand Total. The expression for the EdStatusName count is =Count(Fields!EdStatusName.Value). I inserted a row outside the group but, can't get the correct Sum. Any thoughts?


Not sure, as I can't exactly see your report design. You'll have to provide a lot more details. You may need to use a variable to accumulate that Grand Total, or it might be a matter of where you place the calculation. Sometimes, you end up needing to put something hidden in a details section in order to have something you can SUM up later.


Steve
‌(aka sgmunson)
Smile Smile Smile
Health & Nutrition
NineIron
NineIron
SSCertifiable
SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)

Group: General Forum Members
Points: 5611 Visits: 767
I figured it out. I added a group with a footer then, I added the expression =Count(Fields!EdStatusName.Value) in a cell in the footer.
Thanx.
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