Search code examples
reporting-servicesssrs-2012ssrs-tablix

Grouping a counted variable


I am quite new to SSRS and have what I imagine is a pretty simple question. I have the set up pictured below.

Report set up

What I'm looking for is a list of dates that data exists for then a nested list of outcomes and then how many of each of those outcomes there were on that date. What I get is this,

Result

I want 6/10/2016 > ABORT > to be 3 instead of 1 1 1. What am I doing wrong? Is it possible that I need to change my query somehow?


Solution

  • Try using:

    =COUNT(Fields!sys_OUTCOME.Value,"sys_OUTCOME")
    

    If you don't want to see details rows delete the Details group in the Row Groups pane.

    Code Explanation:

    COUNT: Returns a count of non-null values specified by the expression, evaluated in the context of the given scope.

    REFERENCE

    Every aggregation function can summarize data in a given context of the given scope. In this case the scope I passed to the COUNT function is "sys_OUTCOME" group name (Row Groups) so it will return the count of sys_OUTCOME values by sys_OUTCOME group. If you don't specify the group scope it will count every row without grouping what you was getting initially.

    Let me know if this helps.