在MDX中合并TOPCOUNT和BOTTOMCOUNT结果集

在MDX中合并TOPCOUNT和BOTTOMCOUNT结果集,mdx,olap,bids,Mdx,Olap,Bids,我是MDX新手,有一个简单的需求,使用SQL很容易实现,但我希望使用MDX来实现这一点 我想合并2个查询的结果,因此在查询多维数据集时,我只发送1个以上的查询 select topcount( [Fact].[Year].children, 1,[Measures].[MoneyIn]) on columns from [Cube] 在列上选择topcount([Fact].[Year].children,1[Measures].[MoneyIn]) 从[立方体] 还有这个MDX查询,在几年内获

我是MDX新手,有一个简单的需求,使用SQL很容易实现,但我希望使用MDX来实现这一点

我想合并2个查询的结果,因此在查询多维数据集时,我只发送1个以上的查询

select topcount( [Fact].[Year].children, 1,[Measures].[MoneyIn]) on columns from [Cube] 在列上选择topcount([Fact].[Year].children,1[Measures].[MoneyIn]) 从[立方体] 还有这个MDX查询,在几年内获得最少的资金

select bottomcount( [Fact].[Year].children, 1,[Measures].[MoneyIn]) on columns from [Cube] 在列上选择底部计数([Fact].[Year].children,1,[Measures].[MoneyIn]) 从[立方体] 有没有一种简单的方法可以通过MDX实现这一点?理想情况下,我会有:

MaxValue MinValue 10k -10k 最大值最小值 10k-10k
谢谢!感谢大家的帮助

您可以用几种不同的方式编写查询。这会将计数放在一列中:

SELECT [Measures].[MoneyIn] ON COLUMNS,
{TOPCOUNT([Fact].[Year].children,1, [Measures].[MoneyIn]),
BOTTOMCOUNT([Fact].[Year].children,1, [Measures].[MoneyIn])} ON ROWS
FROM [Cube]
这更接近您的输出,但没有命名列

SELECT [Measures].[MoneyIn] *
       {TOPCOUNT([Fact].[Year].children,1, [Measures].[MoneyIn]),
        BOTTOMCOUNT([Fact].[Year].children,1, [Measures].[MoneyIn])
       } ON COLUMNS
FROM [Cube]

您可以用几种不同的方式编写查询。这会将计数放在一列中:

SELECT [Measures].[MoneyIn] ON COLUMNS,
{TOPCOUNT([Fact].[Year].children,1, [Measures].[MoneyIn]),
BOTTOMCOUNT([Fact].[Year].children,1, [Measures].[MoneyIn])} ON ROWS
FROM [Cube]
这更接近您的输出,但没有命名列

SELECT [Measures].[MoneyIn] *
       {TOPCOUNT([Fact].[Year].children,1, [Measures].[MoneyIn]),
        BOTTOMCOUNT([Fact].[Year].children,1, [Measures].[MoneyIn])
       } ON COLUMNS
FROM [Cube]