非相加事实
我有一个包含 10 个度量的事实表。共 10 个度量中的 9 个在总和级别进行聚合。但是我有单价,这是一个非相加事实度量。当我转到聚合属性并将其设置为 None 时,它在 SSAS 中不起作用,并在多维数据集中给出 NULL 值一旦立方体被处理。那么有什么方法可以处理我的名为 Unit_Price.SO 的非累加性度量,SO 创建了一个 MDX。我不知道这是否是正确的方法。这是我的 MDX。请建议一种执行上述操作的方法。
with member [Measures].[Non Additive Unit Sales] as
case when [Time].Level is [Time].[Month]
and [Gender].Level is [Gender].[Gender]
and [Customers].Level is [Customers].[Name]
and [Product].Level is [Product].[Product Name]
then [Measures].[Unit Sales]
else null
endselect
{[Measures].[Unit Sales],
[Measures].[Non Additive Unit Sales],
[Measures].[Semi Additive Unit Sales]}
* [Gender].Members ON COLUMNS,
[Time].Members ON ROWS
from [Sales]
I have a Fact Table with 10 measures. out of 10 measures 9 are aggregated at Sum level.But I have Unit Price which is a Non-Additive Fact Measure.When I go to the property of Aggregation and make it none it does not work in SSAS and gives NULL values in the Cube once the cube is processed. So is there any way where I can deal with my Non-additive measure called Unit_Price.SO created a MDX. I don't know if this is the right method to do that or not. Here is my MDX.Please suggest a method to do the above.
with member [Measures].[Non Additive Unit Sales] as
case when [Time].Level is [Time].[Month]
and [Gender].Level is [Gender].[Gender]
and [Customers].Level is [Customers].[Name]
and [Product].Level is [Product].[Product Name]
then [Measures].[Unit Sales]
else null
endselect
{[Measures].[Unit Sales],
[Measures].[Non Additive Unit Sales],
[Measures].[Semi Additive Unit Sales]}
* [Gender].Members ON COLUMNS,
[Time].Members ON ROWS
from [Sales]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这不是正确的方法。如果某个度量设置为“不聚合”,则它将不会以必须聚合的任何基数显示。
从本质上讲,单位成本是产品的一个属性,而不是一种衡量标准。有几种方法可以处理它:
将其设置为产品的成员属性。您可以通过 MDX 进行查询,某些查询工具(例如 ProClarity)会将成员属性显示为工具提示。
制作另一个包含单位成本的事实表。每个产品一行,并且不要将度量值组连接到除产品之外的任何维度。您可以将其设置为“不聚合”,并且当您未深入到产品时,该度量将为空白。
It's not the right method. If a measure is set to 'Do Not Aggregate' it will not be shown at any cardinality where it would have to be aggregated.
Essentually, unit cost is an attribute of your Product, not a measure as such. There are a couple of ways to deal with it:
Set it up as a member property of the product. You can query this through MDX, and some query tools (e.g. ProClarity) will show member properties as a tooltip.
Make another fact table with the unit cost. Have one row per product, and don't connect the measure group to any dimension but product. You can set this to 'Do Not Aggregate' and the measure will be blank when you are not drilled down to product.