Count Distinct Problem

  • Hello,

    I have a SSRS report designed as below. The distinct count is working fine and the totals on the bottom of the report are adding correctly. However the Total column is not adding my distinct values correctly

    Directorate    RepMth                             Total (NOT ADDING)
    [Directorate]  [CountDistinct(Client.Value)]  [CountDistinct(Client.Value)] 
    Total        [CountDistinct(Client)]        [CountDistinct(Client.Value)]

    I looked online for a solutions and tried the following

    =Sum(CountDistinct(Fields!Client.Value,"OD_Data"))

    i then got the error: The Value expression for the text box ‘Textbox129’ specifies a scope that is not valid for a nested aggregate.  The scope must be the same name of the scope specified by the outer aggregate or the name of a group or data region that is contained in the scope specified by the outer aggregate.

    Is there a solution to solve this problem? Thanks

  • DISTINCT COUNT is not additive.  The total distinct count can range anywhere from the MAX distinct count to the SUM of the distinct counts depending on how many values are in multiple groups.  Consider the following example:

    A  1
    A  2
    B  2
    B  3

    A has two distinct values, and B has two distinct values, but the total distinct values is three (not four).

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • How is it possible to sum my distinct values?

  • jman76 - Thursday, October 25, 2018 8:22 AM

    How is it possible to sum my distinct values?

    Why would you want to produce a value that has absolutely no meaning?  The question is illogical.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 4 posts - 1 through 3 (of 3 total)

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