mondrian schema学习过程

===== 维度的排序通过 ordinalColumn

      <Level>

=====>   <MemberFormatter>
<Script> return member.getName().substr(member.getName().lastIndexOf('_')+1);
</Script>
</MemberFormatter>
      </Level>

===== 级别 <level>元素中包含了一个>  Degenerate dimensions
=====   内连表
    <Dimension>       <Hierarchy hasAll="true" primaryKey="is_trade_repeat" allLevelName="(汇总)" allMemberName="汇总数据">
        <InlineTable>           <ColumnDefs>
            <ColumnDef>             <ColumnDef name="is_trade_repeat_name" type="String" />
          </ColumnDefs>
          <Rows>
            <Row>
              <Value>               <Value column="is_trade_repeat_name">新客户</Value>
            </Row>
            <Row>
              <Value>               <Value column="is_trade_repeat_name">老客户</Value>
            </Row>
          </Rows>
        </InlineTable>
        <Level>       </Hierarchy>
    </Dimension>

===== view 举例

    <Dimension name="query" caption="搜索关键字" foreignKey="query">
      <Hierarchy>         <View alias="dim_query">
         <SQL>            select DISTINCT `query` as `query`
     from>       </Hierarchy>
    </Dimension>   

===== 

format

http://ask.analytical-labs.com/questions/2855/using-formatstring-strange-results

         <CellFormatter>
        <Script>           <![CDATA[var n = value, 
   >     d = ",", 
   >     s = n < 0 ? "-" : "", 
   >     j = (j = i.length) > 3 ? j % 3 : 0;
   return>         </Script>
      </CellFormatter>


format cell 是不能用的


Datatype 属性有 String、Integer、Numberic、Boolean、Date、Timestamp 等值,默认的是
Numberic ,count 和 distinct-count 度量的默是 Integer 类型。


< Level name="Gender">
< KeyExpression>
< SQL dialect="generic">customer.gender</ SQL>
</ KeyExpression>
</ Level>

高基数属性 highCardinality 是用于通知 Mondiran 这里的维度元素的值很大而且没有定义,
可以选择该属性的值为 true 或 false(默认值)
,当 highCardinality=true 的时候,对超出维度元
素的操作将不会被执行。


The <Level> element allows specifying the optional attribute "approxRowCount". Specifying approxRowCount can improve performance by reducing the need to determine level, hierarchy, and dimension cardinality. This can have a significant impact when connecting to Mondrian via XMLA.


<CalculatedMember name="Profit" dimension="Measures">
<Formula>[Measures].[Store Sales] - [Measures].[Store Cost]</Formula>
<CalculatedMemberProperty> </CalculatedMember>

<CalculatedMember name="NetSalesPercent" 
dimension="Measures"> <CalculatedMemberProperty name="FORMAT_STRING" value="0.0%"/>



 <Dimension name="time" caption="时间" >
  <Hierarchy>       <Table name="dim_thedate"/>
      <Level>       <Level name="month" caption="年月" column="month" type="String" uniqueMembers="false"/>
      <Level>     </Hierarchy>
    <Hierarchy>       <Table name="dim_thedate"/>
      <Level>       <Level name="week" caption="年周" column="week" type="String" uniqueMembers="true" />
      <Level>     </Hierarchy>
  </Dimension> 


衍生度量不能提前生成./的 

自己度量/本身度量的一定要对应到店铺.可以放在御膳房中

直接在返回值里面改


  <CalculatedMember name="auction_num_rate" caption="销售数量占比" dimension="Measures" formula="([Measures].[same_day_auction_num] /sum([Measures].[same_day_auction_num],shop.[shop_id].CurrentMember))">
<CalculatedMemberProperty>   </CalculatedMember>


all交叉没作用

度量type默认为number sum 


打包:addr:10.200.187.68

/ucenter/deploy

sh package.sh 

sh start.sh

日志:/data/ucenter/cs/resin-goods-web/log/

最终读:/data/ucenter/cs/Goods.xml

http://svn.yunat.com/dev2/goods/goods-web/trunk


搜索的话: 轴建模是mdx的函数的事情,搜索的话就是 :mdx row percenty



aggruate 的用处,你妹的




defualtmesure 的用处 




 formatString




 allMemberName




allLevelName
type
property是不显示的




看东西一定要静下心,特别是新东西












measuresCaption?
approxRowCount?
highCardinality?




MondrianException: Mondrian Error:No> =====: 对于衍生维度
exsample:
    <Measure>       <MeasureExpression>
       <SQL>          case when `tb_auction_source`.`iuv`=0 then 0 else `tb_auction_source`.`alipay_winner_num`/`tb_auction_source`.`iuv` end
       </SQL>    
      </MeasureExpression>
   </Measure>




   <CalculatedMember>       <CalculatedMemberProperty name="FORMAT_STRING" value="Percent" />
   </CalculatedMember> 




讲解:
formula解决的是在维度选择过程中生成的度量. 
sql解决的是一开始就确定的度量.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值