SSAS - 自定义总计

发布于 2024-08-11 09:35:29 字数 404 浏览 3 评论 0原文

我正在尝试创建一个多维数据集,其中总数取自事实的属性,而不是作为 SSAS 2005 中子项的聚合进行计算。例如,

假设我有 10 家商店,在某一天都有 100 名顾客光顾。然而,存在一些重叠,一些顾客访问了多家商店。因此,所有商店所属区域的总访客数是事实数据中提供的手动数字,例如

Storename  Date  StoreTotal  RegionTotal  
Store 1  2008-01-01  10  95  
Store 2  2008-01-01  13  95  
Store 3  2008-01-01  11  95  

等等

我如何设计立方体,大概使用计算的度量,将属性作为总计返回,而不是求和从孩子身上衡量?

期待任何想法。

干杯

I'm trying to create a cube where the total is taken from an attribute on the fact and not calculated as an aggregate of the children in SSAS 2005. For example

Assume I have 10 stores which all had 100 customers visit on a particular day. There was however some overlap where some customer visited multiple stores. The total visitors for the region to which all the stores belong therefore is a manual figure provided in the fact data e.g.

Storename  Date  StoreTotal  RegionTotal  
Store 1  2008-01-01  10  95  
Store 2  2008-01-01  13  95  
Store 3  2008-01-01  11  95  

etc etc

How can I design the cube, using a calculated measure presumably, to return the attribute as the aggregate total instead of summing the measure from the children?

Looking forward to any ideas.

cheers

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

今天小雨转甜 2024-08-18 09:35:29

呃,如果我理解正确的话,您正在尝试按原样返回 RegionTotal 吗?将度量的“聚合函数”设置为“无”怎么样?

Er, if I understand correctly you are trying to return RegionTotal as is? How about setting "Aggregate Function" for the measure to "None".

偏闹i 2024-08-18 09:35:29

我在多维数据集中添加了一条 MDX 语句以返回总体级别的替代度量。当时我遇到的问题是,它是在叶级别的每一行返回的,因此总计是对 RegionTotal 求和,而我只想要第一个条目。我最终删除了每个按键组合中除 1 个区域之外的所有区域,这返回了正确的结果,但这是一个非常肮脏的解决方法。我会尝试在某个时候回到这个问题,除非更精通 MDX 的人可以提出替代方案。

I added an MDX statement in the cube to return the alternative measure at total level. The problem I had then was that it was returned for every row at leaf level and therefore the total was summing the RegionTotal where I only wanted the first entry. I ended up removing all but 1 region total per key combination which returns the correct result but is a really dirty workaround. I'll try to come back to this at some point unless someone far more proficient in MDX can come up with an alternative.

陌伤ぢ 2024-08-18 09:35:29

您不能根据 CustomerID 创建一个不同的计数度量吗?然后,立方体将为您计算此值,您无需进行任何手动操作。

Couldn't you just create a distinct count measure based on the CustomerID? The cube would then calculate this for you and you would not have to do any sort of manual manipulation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文