saiku+kettle整合(四)workbench使用

本文介绍如何使用Workbench工具进行Saiku和Kettle的整合,包括连接数据库、创建schema、cube、维度及层次等步骤,并展示了最终生成的XML配置文件。

title: saiku+kettle整合(四)workbench使用 tags:

  • OLAP categories: saiku date: 2016-08-25 18:18:54

workbench使用

  1. 连接数据库
    ![100321_hUlZ_871390.png][]
  2. 创建schema
  3. 创建cube
  4. 创建维度
  5. 创建层次
  6. 创建指标
  7. 保存xml
详细步骤如下  
![100327_Efe3_871390.png][]![100436_5X23_871390.png][]![100445_yPYi_871390.png][]![100456_Ke48_871390.png][]
复制代码
  1. ![100509_iwCB_871390.png][]
  2. 生成xml如下
     <Schema name="maintain2">
          <Cube name="maintain analysis" visible="true" cache="true" enabled="true">
            <Table name="maintain_fact">
            </Table>
            <Dimension type="StandardDimension" visible="true" foreignKey="bill_type" highCardinality="false" name="BillType">
              <Hierarchy name="default" visible="true" hasAll="true" primaryKey="bill_type">
                <Table name="maintain_fact">
                </Table>
                <Level name="billType" visible="true" column="bill_type" type="String" uniqueMembers="true" levelType="Regular" hideMemberIf="Never">
                </Level>
              </Hierarchy>
            </Dimension>
            <Dimension type="StandardDimension" visible="true" foreignKey="org_sk" highCardinality="false" name="Org">
              <Hierarchy name="default" visible="true" hasAll="true" allMemberName="所有公司" primaryKey="org_sk">
                <Table name="org_dim">
                </Table>
                <Level name="org" visible="true" column="org_sk" nameColumn="org_name" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never" captionColumn="org_name">
                </Level>
              </Hierarchy>
            </Dimension>
            <Dimension type="StandardDimension" visible="true" foreignKey="car_sk" highCardinality="false" name="Car">
              <Hierarchy name="default" visible="true" hasAll="true" primaryKey="car_sk">
                <Table name="car_dim">
                </Table>
                <Level name="car" visible="true" column="car_sk" nameColumn="car_no" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
                  <CaptionExpression>
                    <SQL dialect="generic">
                      <![CDATA[CONCAT(car_dim.`car_prefix`,' ',car_dim.`car_no`)]]>
                    </SQL>
                  </CaptionExpression>
                </Level>
              </Hierarchy>
            </Dimension>
            <Dimension type="StandardDimension" visible="true" foreignKey="customer_sk" highCardinality="false" name="Customer">
              <Hierarchy name="default" visible="true" hasAll="true" primaryKey="customer_sk">
                <Table name="customer_dim">
                </Table>
                <Level name="sex" visible="true" column="sex" type="String" uniqueMembers="true" levelType="Regular" hideMemberIf="Never">
                </Level>
                <Level name="customer" visible="true" column="customer_sk" nameColumn="customer_name" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
                </Level>
              </Hierarchy>
            </Dimension>
            <Dimension type="TimeDimension" visible="true" foreignKey="bill_date_sk" name="BillDate">
              <Hierarchy name="default" visible="true" hasAll="true" primaryKey="date_sk">
                <Table name="date_dim" alias="">
                </Table>
                <Level name="year" visible="true" column="year" type="Numeric" uniqueMembers="false" levelType="TimeYears">
                </Level>
                <Level name="quarter" visible="true" column="quarter" type="Numeric" uniqueMembers="false" levelType="TimeQuarters">
                </Level>
                <Level name="month" visible="true" column="month" nameColumn="month_name" type="Numeric" uniqueMembers="false" levelType="TimeMonths">
                </Level>
                <Level name="date" visible="true" column="date" type="Date" uniqueMembers="false" levelType="TimeDays">
                </Level>
              </Hierarchy>
            </Dimension>
            <Measure name="receive_amount" column="receive_amount" formatString="#,####.##" aggregator="sum" visible="true">
            </Measure>
            <Measure name="count" column="maintain_sk" aggregator="count" visible="true">
            </Measure>
            <Measure name="amount" column="amount" formatString="#,####.##" aggregator="sum" visible="true">
            </Measure>
          </Cube>
        </Schema>
    
  ```   


[100321_hUlZ_871390.png]: https://static.oschina.net/uploads/space/2017/0308/100321_hUlZ_871390.png
[100327_Efe3_871390.png]: https://static.oschina.net/uploads/space/2017/0308/100327_Efe3_871390.png
[100436_5X23_871390.png]: https://static.oschina.net/uploads/space/2017/0308/100436_5X23_871390.png
[100445_yPYi_871390.png]: https://static.oschina.net/uploads/space/2017/0308/100445_yPYi_871390.png
[100456_Ke48_871390.png]: https://static.oschina.net/uploads/space/2017/0308/100456_Ke48_871390.png
[100509_iwCB_871390.png]: https://static.oschina.net/uploads/space/2017/0308/100509_iwCB_871390.png
复制代码
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值