关于 SSAS 多维数据集中的聚合/求和列
我正在 SQL Server 2016 和 SSDT2015 上使用 SSAS Cube 开发一个简单的项目。 DW_Orders 数据库来自 Orders DW。表因子订单包含属性 UnitPrice、Quantity 和 Discount,计算成员 TotalSale 定义为 [Measures].[Unit Price][Measures].[Quantity](1-[Measures].[Discount] ),以及 FK 成员 CustomerID 和 OrgID。我想从维度 dimCustomers 获取基于国家/地区-城市层次结构的 TotalSale。但我得到了以下结果: 在此处输入图片描述
很明显,单价、数量和折扣已在城市下汇总或国家/地区,因此我们从计算中得到了错误的 TotalSale 负结果。在编辑测量中尝试过,无法得到我所期望的。某些设置需要您的帮助,谢谢。
I am working on a simple project using SSAS Cube on SQL Server 2016 and SSDT2015. DW_Orders database is from Orders DW. The table factor orders contains attributes UnitPrice, Quantity and Discount with the calculation member TotalSale defined as [Measures].[Unit Price][Measures].[Quantity](1-[Measures].[Discount]), well as the FK members CustomerID and OrgID. I want to get the TotalSale based on Country-City Hierarchy from dimension dimCustomers. But I got the following result:
enter image description here
it is obvious that the UnitPrice, Quantity and Discount have been summed under the city or country so that we got wrong and negative result of TotalSale from the calculation. Tried in the Edit Measure, cannot get what I expect. Need your help on some settings, thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要编辑 2 个度量(折扣和单价)的聚合类型。默认情况下,类型为SUM,需要使用Average。为此,请转到度量值组,选择度量并访问其属性以设置聚合。
You need to edit the aggregation type for the 2 measures(discount and unit price). By default, the type is SUM, you need to use Average. To do that, go to the measure group, select the measure and access its properties to set the aggregation.