如何删除底部计数中的空值,即。我只想查看实际销售单位的产品,我尝试过非空和非空但没有成功。
with
member [Measures].[Amount Sold] as
([Measures].[Internet Sales Amount]),
format_string = "currency"
select {[Measures].[Amount Sold]}
on columns,
bottomcount(
order(
{[Product].[Product].Members},
([Measures].[Amount Sold]), bdesc),
5 )on rows
您可以使用以下方式过滤 [Product].MembersNOT ISEMPTY()
排除所有空值,然后对过滤后的集合进行底部计数。
with member [Measures].[Amount Sold] as
([Measures].[Internet Sales Amount]),
format_string = "currency"
select
{[Measures].[Amount Sold]} on columns,
order(
bottomcount(
filter({[Product].[Product].Members}, NOT ISEMPTY([Measures].[Amount Sold])),
5,
[Measures].[Amount Sold]),
[Measures].[Amount Sold], bdesc) on rows
from [Adventure Works]
注意BottomCount()
将进行升序、打破层次结构排序,因此您需要执行以下操作Order()
如果您想要降序排列,请在其顶部。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)