help with MDX

  • I need to count distinct attributes of one of my dimensions in instances where a measure has a certain value. This is what I have so far but the syntax is wrong. Any suggestions would be greatly appreciated.

    DISTINCTCOUNT( CASE WHEN [Measures].[Alerts Completed] = 1 THEN [Member].[Secondary ID] ELSE NULL)

  • Don't Case statements need an "End" to terminate them?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • you are right - thanks. let me see if that fixes ikt

  • that fixes the syntax but it displays 0s for every row - even those where the measure that is tested is set to 1...

    DISTINCTCOUNT( {CASE WHEN [Measures].[Alerts Completed] = 1 THEN [Member].[Secondary ID] ELSE NULL END})

    note - i also added brackets to the CASE statement

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

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