gpt4 book ai didi

null - 如何删除空值?

转载 作者:行者123 更新时间:2023-12-05 01:01:14 24 4
gpt4 key购买 nike

如何删除 bottomcount 中的空值,即。我只想查看实际销售单位的产品,我尝试使用 nonempty 和 non empty 都没有成功。

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

最佳答案

您可以使用 NOT ISEMPTY() 过滤 [Product].Members 以排除所有空值,然后对过滤后的集合进行底部计数。

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() .

关于null - 如何删除空值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15788528/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com