我正在尝试制作一个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]
答案 0 :(得分:2)
以下应该做你想做的事:
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]