SSAS 2008 链接立方体/动态数据集给出了奇怪的总计 - MDX 乐趣

发布于 2024-08-07 15:48:02 字数 1221 浏览 3 评论 0原文

我们在 AS 2008 中构建了一个双多维数据集解决方案,其工作原理如下:一个包含所有客户端的 Widget 数据的行业多维数据集,以及一个包含 Widget 数据和应用程序的客户端多维数据集。与行业共享多个(但不是全部)维度。行业多维数据集包含所有人,包括调用客户端,因此当客户提取行业度量时,我们希望结果包括其他所有人。客户在行业立方体中以“客户”维度表示,该维度只有两个成员:键和键。客户名称。行业立方体的计数度量称为[I Widget Count] & [I Widget Count]。客户端多维数据集中的相同度量是 [Widget Count]。

像这样的 MDX 表达式在查询编辑器中效果很好:

WITH SET [Industry] AS Except( [Cube Clients].[Client].[All].Children
        , [Cube Clients].[Client].[Client 05] )
    MEMBER [Measures].[Industry Widget Count] AS sum( [Industry], [I Widget Count] )
SELECT ({ [Widget Count]
    , [Industry Widget Count]
    , [I Widget Count] }) on 0
FROM [Client 05 Cube]

一切看起来都很好,客户端和客户端的计数都很好。产业都很完善。向轴 1 添加共享或非共享尺寸也有效,&一切看起来都很棒。

一旦我将集合添加到立方体本身,求和函数就不再给出正确的答案。因此,在计算的度量屏幕中,我添加了:

CREATE DYNAMIC SET CURRENTCUBE.[Industry] 
  AS Except( [Cube Clients].[Client].[All].Children
    , [Cube Clients].[Client].[Client 05] ) ;

CREATE MEMBER CURRENTCUBE.[Measures].[Industry Widget Count] 
  AS sum( [Industry], [I Widget Count] ), 
VISIBLE = 1 ;

在多维数据集中浏览此度量时,计数完全错误。正确的数字(没有尺寸限制)约为 10,000,000 和 10,000,000。浏览器显示 30。我尝试通过跟踪窗口查看是否可以读取多维数据集用于生成动态总和的代码,但它不可见。

任何人都知道为什么会发生这种情况?

We have a two-cube solution built in AS 2008 that works like this: an Industry cube that contains Widget data for all clients, and a Client cube that contains Widget data & shares several (but not all) dimensions with the Industry. The Industry cube contains everybody, including the calling client, so when the Client is pulling an Industry measure, we want the results to include everybody else. Clients are represented in the Industry cube with a "clients" dimension that just has two members: the key & the client name. The industry cube's count measure is called [I Widget Count] & the same measure in the client cube is [Widget Count].

An MDX expression like this works great from the query editor:

WITH SET [Industry] AS Except( [Cube Clients].[Client].[All].Children
        , [Cube Clients].[Client].[Client 05] )
    MEMBER [Measures].[Industry Widget Count] AS sum( [Industry], [I Widget Count] )
SELECT ({ [Widget Count]
    , [Industry Widget Count]
    , [I Widget Count] }) on 0
FROM [Client 05 Cube]

Everything seems fine, the counts for client & industry are perfect. Adding shared or non-shared dimensions to axis 1 works also, & everything seems great.

As soon as I add the set to the cube itself, the sum functions stop giving correct answers. So, in the calculated measures screen I've added:

CREATE DYNAMIC SET CURRENTCUBE.[Industry] 
  AS Except( [Cube Clients].[Client].[All].Children
    , [Cube Clients].[Client].[Client 05] ) ;

CREATE MEMBER CURRENTCUBE.[Measures].[Industry Widget Count] 
  AS sum( [Industry], [I Widget Count] ), 
VISIBLE = 1 ;

When browsing this measure in the cube, the count is completely wrong. The correct number (with no dimension constraints) is around 10,000,000 & the browser shows 30. I've tried looking through a trace window to see if I can read the code that the cube is using to generate the dynamic sum, but it is not visible.

Anyone have a clue why this is happening?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文