我正在尝试创建一个MDX查询,它可以告诉我在中国以外的国家销售了多少产品。使用下面的查询,我只能获得每个国家的瓶装水销售量,但不能得到它们的总和。如何修改查询以获得其总和?
SELECT NON EMPTY Except(
{[Location].[All Places].Children},
{[Location].[China]}
) ON COLUMNS,
{[Product].[All Products].[Bottled Water].Children} ON ROWS
FROM [Places]
WHERE [Measures].[Units Sold]发布于 2011-06-11 15:11:55
以下代码应该可以执行您想要的操作:
WITH
SET [countries] as Except( {[Location].[All Places].Children}, {[Location].[China]} )
MEMBER [measures].[X] as Sum( [countries] , [Measures].[Units Sold] )
SELECT {[Product].[All Products].[Bottled Water].Children} ON ROWS
FROM [Places]
WHERE [measures].[x]https://stackoverflow.com/questions/6308489
复制相似问题