Don't Count Distinct Null

  • My measure group contains only a single measure that applies a distinct count aggregation, that also counts null as 1. Is there a way to not count the null records.

    eg. Country Desc

  • Duplicate post. No replies to this thread please. Direct replies to:http://www.sqlservercentral.com/Forums/Topic810071-17-1.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • I had the same problem. I solved it by creating a view with a WHERE condition ISNULL(ID,0) <> 0 and then creating a Distinct Count out of this view

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

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