我尝试按照下面的链接所述进行操作
https://activeviam.com/en/resource-center/advanced-mdx-queries
但是我的查询花费了很长时间,然后超时错误。
SELECT NON EMPTY
Generate
(
[Cube Company].[Name].MEMBERS,
TopCount
(
{[Cube Company].[Name].CurrentMember} * [Cube Product].[ALL].
[AllMember].Children,
10,
[Measures].[sales]
)
) ON ROWS,
{MEASURES.[sales]} ON COLUMNS
FROM [DB];
我还尝试了示例查询,该查询在下一页中显示每个日历年的前10个产品,并带有过滤器和不带过滤器,并且仍然存在相同的错误:
https://docs.microsoft.com/en-us/sql/mdx/generate-mdx?view=sql-server-2017
SELECT NON EMPTY
{[Measures].[sales]} ON COLUMNS,
Generate(
[Cube Company].[Name].MEMBERS,
TopCount(
[Cube Company].[Name].CURRENTMEMBER
* FILTER([Cube Product].[Name].MEMBERS, [Measures].[sales]>0),
10,
[Measures].[sales]
)
) ON ROWS
FROM [DB];