本文介绍了SSAS维度属性作为计算量度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在尝试实现维度属性的平均值时遇到一些问题.

I am having some issues trying to implement an average of a dimension attribute.

基本结构是:

  • 预订标题尺寸
  • 事实表(每个预订标题多行条目)
  • Booking Header Dimension
  • Fact Table (multiple rows per Booking Headerentry)

在预订标头维度上,我有一个名为预订窗口"的数值属性,并且我希望能够创建一个计算得出的将该值取平均值的度量.

On the booking header dimension I have a numerical attribute called Booking Window, and I want to be able to create a calculated measure that averages this value.

我们正在使用SQL Server 2012标准版.

We are using SQL Server 2012 standard edition.

任何帮助将不胜感激.

推荐答案

最好的方法是从维度表中创建度量值组(在BIDS中,转到多维数据集设计器的多维数据集结构"选项卡,右键单击度量列表中的多维数据集对象,然后选择新建度量值组",然后选择尺寸表. BIDS会生成一些度量,并且您可以删除除两个以外的所有度量:一个基于您的数值属性(我将其称为"YourSummedAttrib",其名称在下文中称为),以及计数度量.量度"YourSummedAttrib"的合计函数可能是"sum",保持不变.

The best approach would be to create a measure group from the dimension table (in BIDS, go to cube designer, tab "Cube Structure", right-click the cube object in the Measures list, and select "New Measure Group", select your dimension table). BIDS will generate some measures, and you can remove all but two: the one based on your numeric attribute (I will call it "YourSummedAttrib" to have a name to refer to below), and the count measure. The aggregate function for the measure "YourSummedAttrib" will probably be "sum", leave that as it is.

然后,创建一个计算得出的度量,将"YourSummedAttrib"除以计数度量,得出平均值.最后,如果您已对所有内容进行了测试,则在将多维数据集提供给用户之前,使两个度量"YourSummedAttrib"和计数度量不可见,因为他们只需要查看平均值即计算得出的度量即可.

Then, create a calculated measure which divides "YourSummedAttrib" by the count measure, which gives the average. Finally, if you have tested everything, make the two measures "YourSummedAttrib" and the count measure invisible before you give the cube to the users, as they only need to see the average, which is the calculated measure.

这篇关于SSAS维度属性作为计算量度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 20:52