获取 MDX 中每家商店的总销售额(百分比)

Issue getting the total sale accounted by each store in MDX (in percent)

我希望能够在 SSRS 中创建以下 table:

StoreKey    StorePercentage
1024        50 %
1037        20 %
1111        13 %
1949        27 %

我遇到过无法使用聚合数据创建图表的情况。因此,我尝试在 SSAS 中指定 StorePercentage 值(因为我在 SSRS 中使用分析服务器作为数据源)并将其导入 SSRS 并使用值 立即行动。为了创建这个数据集,我开始在 SSMS:

中测试这个查询
With MEMBER [Measures].[StorePercentage] AS
    SUM (
            {
            [Dim Store2].[Store Key],[Dim Date].[Calender].[Date].[2014-11-23]:[Dim Date].[Calender].[Date].[2014-11-29]
            }, [Measures].[Total Price] 
        )
    / SUM
        ( 
            {
                [Dim Date].[Calender].[Date].[2014-11-23]:[Dim Date].[Calender].[Date].[2014-11-29]
            }, [Measures].[Total Sales]
        )
    Select non empty
        {
        [Measures].[Total Price],[Measures].[StorePercentage] 
        } on 0,
    [Dim Store2].[Store Key].children on 1
    FROM [theyseemecubintheyhatin]

但这给了我:

StoreKey    Total Price     StorePercentage
1024        50424           #Error
1037        3434            #Error
1111        1333            #Error
1949        2443            #Error

,即我计算的措施似乎有问题。

With MEMBER 子句中,我在查询中基本上尝试做的是:

SUM(Total sale made by each store and date range separately)/SUM(Total Sales for all stores over the time interval)

但我似乎对此有一些疑问。我在查询中尝试了 {( 的一系列不同组合,但我还没有得到它的工作。

有人知道吗?当我尝试 Google 这个问题时,我发现的查询与获取度量和特定日期范围的数据有关,但我也需要查询每个商店。

我认为这样更有意义:

With 
Member [Measures].[StorePercentage] AS
[Measures].[Total Price]
/
([Dim Store2].[Store Key].[All],[Measures].[Total Price])

select 
non empty {[Measures].[Total Price],[Measures].[StorePercentage]} on 0,
non empty [Dim Store2].[Store Key].[Store Key].Members on 1
from [theyseemecubintheyhatin]
where ({[Dim Date].[Calender].[Date].[2014-11-23]:[Dim Date].[Calender].[Date].[2014-11-29]})

问题代码在这里:

{[Dim Store2].[Store Key],[Dim Date].[Calender].[Date].[2014-11-23]:[Dim Date].[Calender].[Date].[2014-11-29]}

因为[Dim Store2].[Store Key]没有任何意义。