Mondrian系列(三)-如何设计Mondrian的Schema(2)-逻辑模型

来源:互联网 发布:阿里巴巴 软银 知乎 编辑:程序博客网 时间:2024/06/05 04:28

3.逻辑模型

Schema的最重要的组成部分是cube、度量measure和维度dimension。

  • cube是在某一特定主题区域中维度和度量的集合
  • 度量measure是你所感兴趣的测量数量,例如产品的销售数量或库存成本
  • 维度dimension是一种属性,或一系列属性,取决于你如何将度量划分成子类型。例如,你可能希望

 


   
       


       
           
               

               
           
       
       
           
               

               
               
               
           
       
       
       
       
       
           
       

   

上面的例子schema包含一个cube,叫做"Sales”。这个cube有两个维度,“time”和“Gender”,还有两个度量值,“Unit Sales”和“Store Sales”。我们可以基于这个Schema写一个MDX查询:

SELECT {[Measures].[Unit Sales],[Measures].[Store Sales]} ON COLUMNS,{descendants([Time].[1997].[Q1])} ON ROWS FROM [Sales] WHERE [Gender].[F]

这个查询语句基于Sales Cube([Sales]),性别是女。下面是查询结果。

[Time]             [Measures].[Unit Sales]      [Measures].[Store Sales]

[1997].[Q1]        0                                                 0

[1997].[Q1].[Jan]  0                                                 0

[1997].[Q1].[Feb]  0                                                 0

[1997].[Q1].[Mar]  0                                                 0

原创粉丝点击