0

我有一个像这样的 MDX 查询:

with 
member [Measures].[Currency] as [Currency].[Code].Currentmember.Member_Key
member [Measures].[Date] as [Time].[Date].Currentmember.Member_Key
member [Measures].[Wholesale Price Totals] as [Measures].[Wholesale Price] * [Measures].[Net Sold Units]
select
{
[Measures].[Currency]
,[Measures].[Date]
,[Measures].[Sold Units]
,[Measures].[Wholesale Price Totals]
}
on columns,
ORDER
(
    NONEMPTY
    (
        CROSSJOIN
        (
            {[Time].[Date].&[2013-02-26T00:00:00],[Time].[Date].&[2013-02-27T00:00:00]}
            ,EXCEPT([Currency].[Code].Members, [Currency].[Code].[All])
        ), 
        [Measures].[Sold Units]
    ), 
    [Measures].[Date], BASC
)
on rows
from MyCube

我需要将所有 [Sold Units](数量)* [Wholesale Price] 的总和作为 [Wholesale Price Totals]。像这样的查询检索所有已售单位的总和乘以 Wolesale 价格的总和,我需要将每个已售单位“单元格”的总和乘以它们的批发价格。

我从几天前就开始尝试这样做,这让我发疯了!

提前致谢!

4

1 回答 1

0

乘法需要在叶级别完成,这使得它比常规措施慢得多。理想情况下,您应该在 ETL 阶段考虑乘法。如果不行,可以使用下面帖子http://sqlblog.com/blogs/mosha/archive/2005/02/13/performance-of-aggregating-data-from-lower-levels-中描述的方法在-mdx.aspx

于 2013-04-25T06:43:38.593 回答