Rate,Percentage,Average in Essbase

来源:互联网 发布:平价好用的面霜知乎 编辑:程序博客网 时间:2024/05/14 12:42

I have done a lot of notes about Essbase today. First of all, what is Essbase? It used to be a production of hyperion company. Hyperion is the leader in business performance management software, Brio Software, and a leading provider of next generation business intelligence software. On March 1st, 2007 Oracle spent 330 million U.S dollars on the acquisition of this company and which became a sansation overnight. Everyone who works as a software engineer knows that when developing a project, we always select a relational database as our store space. In the system, entities are connected by relationship. So there are two kinds of tables, one is an entity table and the other is a relational table. Unlike the relational database, Essbase is a multidimensional database, or we might as well say that it is an industry-leading OLAP solution. In Essbase, several dimensions determines a point of data(a data), and we can call it a cell. Then it becomes familiar to here the word cube.
Today I accidently found that [wastage rate] was larger than 1. In Essbase [wastage rate] is an account dimension(指标数据), and the only other dimension is time dimension(营运日期). In the [营运日期]dimension, the structure is as follows:
2005(+)
   2005-Q1(+)
      2005-1(+)
         20050101(+)
……
"(+)"means that the higher level member's value is the sum of the members of the straight lower level. For example, the value of [2005] is sum([2005-Q1],[2005-Q2],[2005-Q3],[2005-Q4]). So the wastage rate in a higher level is the sum of the members of the straight lower level and might be over 1 after the "+" operation. But this is obviously wrong because rate is never bigger than 1.
One solution for this problem is that we make it as a calculation member so we can use a MDX expression_r_r to figure the rate out.(流失率本来作为一个指标member而存在,加载的时候会直接往该项加载数据。但是数据加载的时候是加载最底层的数据,即某一天的数据,如果后面前台出现查询月汇总数据,那么流失率将按照每一天累加到月,这样做的结果就有可能导致流失率大于1的情况出现,即使不出现累加出来的流失率也是错误的。正确的做法应该是:如果是查询某一个月的流失率,那么流失率=该月流失金额总和/该月金额总和,而不是该月每日流失率的相加。所以,可以把流失率当作一个计算指标,这样就可以使用MDX语句来实现流失率的计算。其中,脚本类似:[流失金额]/[金额]。像求平均数啊之类的也是如此解决)

 

原创粉丝点击