Hi, I am trying to create one cube definition with role playing dimension.

To explain, I have a fact with source_city_id and destination_city_id
columns. Both of this has to map to the same dimension City.

Tried to dereference cube-0.1.xsd and I was able to get to this state.
I am not sure what is wrong here.

It would be great if you can give me an example cube file with this use
case. It would be of great help for anyone who wants to understand this a
little more deeply.

<?xml version="1.0" encoding="UTF-8"?>
<x_base_cube name="sales_cube" xmlns="uri:lens:cube:0.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="uri:lens:cube:0.1 cube-0.1.xsd ">
  <measures>
    <measure name="units" type="INT" default_aggr="SUM" />
    <measure name="amounts" type="INT" default_aggr="SUM" />
  </measures>
  <expressions>
    <expression name="expr_msr" type="DOUBLE" expr="units + amounts" />
  </expressions>
  <dim_attributes>
    <dim_attribute name="category" type="STRING" />
    <dim_attribute name="source_city_id" type="INT">
      <ref_spec>
        <chain_ref_column chain_name="source_city" ref_col="id" />
      </ref_spec>
    </dim_attribute>
    <dim_attribute name="dest_city_id" type="INT">
      <ref_spec>
        <chain_ref_column chain_name="dest_city" ref_col="id" />
      </ref_spec>
    </dim_attribute>
  </dim_attributes>
  <join_chains>
    <join_chain name="source_city">
      <paths>
        <path>
          <edges>
            <edge>
              <from table="sales_cube" column="source_city_id"/>
              <to table="city" column="id"/>
            </edge>
          </edges>
        </path>
      </paths>
    </join_chain>
    <join_chain name="dest_city">
      <paths>
        <path>
          <edges>
            <edge>
              <from table="sales_cube" column="dest_city_id"/>
              <to table="city" column="id"/>
            </edge>
          </edges>
        </path>
      </paths>
    </join_chain>
  </join_chains>
  <properties>
    <property name="sample_cube.prop" value="sample" />
    <property name="cube.sample_cube.timed.dimensions.list" value="dt" />
  </properties>
</x_base_cube>

Thanks and regards,

-- 
Amruth S
(09486075517)

Reply via email to