本文介绍了如何为所有措施创建差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在立方体中,我有很多措施,我想计算

In the cube I have lots of measures that I want to calculate the variance of

的方差所以,如果我有一个称为毛利的措施,我想要像 

So if I have a measure called gross profit and I want something like 

我可以做一个范围界定声明,如

I can do a scoping statement like

创建成员CURRENTCUBE。[Measures]。[毛利润]

  AS 

[措施]。[价值]

, 

FORMAT_STRING =&#; ## 0;(#,## 0)",$
VISIBLE = 1,  DISPLAY_FOLDER ='利润'

CREATE MEMBER CURRENTCUBE.[Measures].[Gross Profit]
 AS 
[Measures].[Value]

FORMAT_STRING = "#,##0;(#,##0)",
VISIBLE = 1 ,  DISPLAY_FOLDER = 'Profits'

范围(后代([场景]。[场景名称]。& [Fcst vs Actual] ,, SELF_AND_AFTER ),[措施]。[价值]);  

Scope(Descendants([Scenario].[Scenario Name].&[Fcst vs Actual],,SELF_AND_AFTER),[Measures].[Value]);  

这= =
总和([情景]。[情景名称]。& [ Fcst],[措施]。[价值])  -

总和([情景]。[情景名称]。& [实际],[措施]。[价值])

;      

结束范围; 

This =
sum([Scenario].[Scenario Name].&[Fcst], [Measures].[Value])  -
sum([Scenario].[Scenario Name].&[Actual], [Measures].[Value])
;      
end scope; 

我的问题是,如果度量是一个计算度量并且它使用了两种不同的基本度量,我该怎么做呢?来自不同的事实,例如

My issue is how can I do this if the measure was a calculated measure and it uses 2 different base measures from different facts like

创建会员CURRENTCUBE。[措施]。[总利润]

  AS 

[Measures]。[Value] + [Measures]。[Value2]

, 

FORMAT_STRING ="#,## 0; (#,## 0)",

CREATE MEMBER CURRENTCUBE.[Measures].[Total Gross Profits]
 AS 
[Measures].[Value] + [Measures].[Value2]

FORMAT_STRING = "#,##0;(#,##0)",

VISIBLE = 1,  DISPLAY_FOLDER ='利润';

我不能一次确定2个值。 

I can't scope 2 values at once. 

此示例已简化为试用提出问题。但在实际系统中,我基本上有7个事实表,每个事件表只有on value列,并且计算使用维度层次结构来计算度量值,例如 

This sample is simplified to try to get the question across. But in the actual system I have basically 7 fact tables with just on value column each and the calculations are using dimension hierarchies to calculate the measure's value like 



 

推荐答案





这篇关于如何为所有措施创建差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-26 20:28