区分计数以排除NULL [英] Distinct count to exclude NULL

查看:94
本文介绍了区分计数以排除NULL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以创建一个计算得出的度量,该度量可以进行不同的计数,但不包括空值?例如,如果我有:10、20、20,null;不重复的计数是3,但是我能得到的答案是2吗?

Is there a way to create a calculated measure that can do a distinct count, but excluding the null values? For example, if I have: 10, 20, 20, null; the distinct count is 3, but can I have the answer as 2?

推荐答案

感谢您提供所有答案.但是,在这里我找到了最适合我需要的解决方案: http://richardlees.blogspot.com/2008/10/alternative-to-physical-distinct-count.html

Thank you for all the answers. However, here I found a solution that works best for my need: http://richardlees.blogspot.com/2008/10/alternative-to-physical-distinct-count.html

通过使用以下内容创建计算所得成员:

By creating a Calculated Member using the following:

count(nonempty({[DimName].[HierarchyName].[LevelName].members-[DimName].[HierarchyName][All].UNKNOWNMEMBER},[Measures].[MyMeasure]))

这篇关于区分计数以排除NULL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆