Distinct count

  • Hi all,

    Prolly easy question, but for some reason the query below does not return the distinct count but just the count. Should be 16 but it's retruning 17. Any help? 🙂

    WITH SET [MySet] AS

    NONEMPTY(

    FILTER(

    [Geography].[City].[City].Members,

    instr(left([Geography].[City].currentmember.name,1), 'A') > 0

    ),

    [Measures].[Internet Order Count]

    )

    MEMBER [Measures].[CountMembers] AS

    DISTINCTCOUNT([MySet])

    //why not distinct?

    SELECT {

    [Measures].[Internet Order Count],

    [Measures].[CountMembers]

    }

    ON COLUMNS,

    [MySet]

    ON ROWS

    FROM [Adventure Works]

  • It's returning 17 as there are 17 members in your set.

    Augsburg is listed twice but it's still two distinct members that have different properties further up the hierarchy -

    [Geography].[Geography].[City].&[Augsburg]&[HH]

    [Geography].[Geography].[City].&[Augsburg]&[BY]

    One is in the Bayern province and the other is in Hamburg.


    I'm on LinkedIn

  • Hi,

    Thanks for your answer! I found that out yesterday as well after searching a while .. :/

    Thanks!

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

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