是的,如果您想要动态聚合(即反映在较低级别应用的过滤器的父总计),您可以使用子选择。
比较我们在选择中过滤客户集的查询:
SELECT
{[Measures].[Internet Order Quantity], [Measures].[Internet Sales Amount]} ON 0,
Union(
[Customer].[Customer Geography].[All Customers],
Filter([Customer].[Customer Geography].[Country],
[Measures].[Internet Order Quantity] > 6000)
) ON 1
FROM [Adventure Works]
// Results
Internet Order Quantity Internet Sales Amount
All Customers 60,398 $29,358,677.22
Australia 13,345 $9,061,000.58
Canada 7,620 $1,977,844.86
United Kingdom 6,906 $3,391,712.21
United States 21,344 $9,389,789.51
使用查询,我们在其中子选择过滤的客户集,导致重新聚合,然后选择新的总数:
SELECT
{[Measures].[Internet Order Quantity], [Measures].[Internet Sales Amount]} ON 0,
Union(
[Customer].[Customer Geography].[All Customers],
[Customer].[Customer Geography].[Country]
) ON 1
FROM (
SELECT Filter([Customer].[Customer Geography].[Country],
[Measures].[Internet Order Quantity] > 6000) ON 0
FROM [Adventure Works]
)
// Results
Internet Order Quantity Internet Sales Amount
All Customers 49,215 $23,820,347.17
Australia 13,345 $9,061,000.58
Canada 7,620 $1,977,844.86
United Kingdom 6,906 $3,391,712.21
United States 21,344 $9,389,789.51