Quantcast
Channel: Pentaho Community Forums
Viewing all articles
Browse latest Browse all 16689

Error using Mondrian 4 aggregate tables

$
0
0
Trying to port my schema from v3 to v4, and I'm having trouble with aggregate tables. The docs haven't even been updated yet to describe what everything is which is frustrating, and the Mondrian in Action book briefly talks about it, but that's it. There is also nothing on the internet to help with problems either.

I'm getting the following error:

Caused by: mondrian.rolap.RolapSchema$PhysSchemaException: Could not find a path from agg_year_employment to any of [Employment as employment]
at mondrian.rolap.RolapSchema$PhysSchemaGraph.findUniquePath(RolapSchema.java:1211)
at mondrian.rolap.RolapSchema$PhysSchemaGraph.addHopsBetween(RolapSchema.java:1161)
at mondrian.rolap.RolapSchema$PhysSchemaGraph.findPath(RolapSchema.java:1307)
at mondrian.rolap.RolapSchemaLoader.registerExpr(RolapSchemaLoader.java:2222)
...

Here is the relevant sections from my schema:

Code:

  <PhysicalSchema>
      <Table name='agg_year_employment'/>
  </PhysicalSchema>

<Cube name="workforce" visible="true" caption="%{cube.workforce}" cache="true" enabled="true" enableScenarios="false">        <Dimensions>
            <Dimension name="employmentDate" source="Time" visible="true" caption="%{dimension.employmentDate}"/>
            <Dimension name="employee" source="Employee" visible="true" caption="%{dimension.employee}"/>
            <Dimension name="organization" source="Organization" visible="true" caption="%{dimension.organization}"/>
            <Dimension name="workLocation" source="WorkLocation" visible="true" caption="%{dimension.workLocation}"/>
            <Dimension name="residenceLocation" source="Region" visible="true" caption="%{dimension.residenceLocation}"/>
            <Dimension name="employeeStatus" visible="true" caption="%{dimension.employeeStatus}" key="$Id" hanger="false">
                <Hierarchies>
                    <Hierarchy name="employeeStatus" visible="true" hasAll="true" caption="%{dimension.employeeStatus}">
                        <Level name="employeeStatus" visible="true" attribute="employeeStatus" hideMemberIf="Never" caption="%{level.employeeStatus}">
                        </Level>
                    </Hierarchy>
                </Hierarchies>
                <Attributes>
                    <Attribute name="employeeStatus" caption="%{level.employeeStatus}" levelType="Regular" table="Employee_Status" datatype="Integer" hasHierarchy="false">
                        <Key>
                            <Column table="Employee_Status" name="id"/>

                        </Key>
                        <Name>
                            <Column table="Employee_Status" name="default_description"/>

                        </Name>
                        <OrderBy>
                            <Column table="Employee_Status" name="id"/>

                        </OrderBy>
                    </Attribute>
                    <Attribute name="$Id" levelType="Regular" table="Employee_Status" keyColumn="id" hasHierarchy="false">
                    </Attribute>
                </Attributes>
            </Dimension>
        <MeasureGroups>
            <MeasureGroup name="workforce" type="fact" table="employment">
                <Measures>
                    <Measure name="headCount" column="headcount" formatString="#,###" datatype="Integer" aggregator="sum" caption="%{measure.headCount}"/>
                    <Measure name="terminations" column="termination" formatString="#,###" datatype="Integer" aggregator="sum" caption="%{measure.terminations}"/>
                    <Measure name="newHires" column="new_hire" formatString="#,###" datatype="Integer" aggregator="sum" caption="%{measure.newHires}"/>
                    <Measure name="retroHires" column="retro_hire" formatString="#,###" datatype="Integer" aggregator="sum" caption="%{measure.retroHires}"/>
                    <Measure name="transfers" column="transfer" formatString="#,###" datatype="Integer" aggregator="sum" caption="%{measure.transfers}"/>
                    <Measure name="hourlyRate" column="usd_hourly_rate" formatString="Currency" datatype="Numeric" aggregator="sum" caption="%{measure.hourlyRate}"/>
                    <Measure name="averageTenure" column="tenure" datatype="Integer" aggregator="avg" caption="%{measure.avgTenure}"/>
                    <Measure name="avgPerformanceBand" column="performance_band" formatString="0.0%" datatype="Integer" aggregator="avg" caption="%{measure.avgPerformanceBand}"/>
                </Measures>
                <DimensionLinks>
                    <ForeignKeyLink dimension="employee" foreignKeyColumn="employee_id"/>
                    <ForeignKeyLink dimension="organization" foreignKeyColumn="company_structure_id"/>
                    <ForeignKeyLink dimension="workLocation" foreignKeyColumn="work_address_id"/>
                    <ForeignKeyLink dimension="residenceLocation" foreignKeyColumn="residence_address_id"/>
                    <ForeignKeyLink dimension="employeeStatus" foreignKeyColumn="employee_status_id"/>
                </DimensionLinks>
            </MeasureGroup>
          <MeasureGroup table="agg_year_employment" type="aggregate">
              <Measures>
                  <MeasureRef name="headCount" aggColumn="headcount"/>
                  <MeasureRef name="terminations" aggColumn="termination"/>
                  <MeasureRef name="newHires" aggColumn="new_hire"/>
                  <MeasureRef name="retroHires" aggColumn="retro_hire"/>
                  <MeasureRef name="transfers" aggColumn="transfer" />
                  <MeasureRef name="hourlyRate" aggColumn="usd_hourly_rate"/>
                  <MeasureRef name="averageTenure" aggColumn="tenure"/>
                  <MeasureRef name="avgPerformanceBand" aggColumn="performance_band"/>
              </Measures>
              <DimensionLinks>
                  <ForeignKeyLink dimension="employee" foreignKeyColumn="employee_id"/>
                  <ForeignKeyLink dimension="organization" foreignKeyColumn="company_structure_id"/>
                  <ForeignKeyLink dimension="workLocation" foreignKeyColumn="work_address_id"/>
                  <ForeignKeyLink dimension="residenceLocation" foreignKeyColumn="residence_address_id"/>
                  <ForeignKeyLink dimension="employeeStatus" foreignKeyColumn="employee_status_id"/>
                  <CopyLink dimension="employmentDate" attribute="Year">
                      <Column table="time" name="year" aggColumn="yearquartermonth_year"/>
                  </CopyLink>
              </DimensionLinks>
          </MeasureGroup>
    </Cube>

So how is this "linked" to the Employment fact table? Do I need to use Link tags in PhysicalSchema?

Viewing all articles
Browse latest Browse all 16689