Welcome to Knowage Q&A, where you can ask questions and receive answers from other members of the community.
0 votes
1 view

Hi all,

I have created a mondrain template and then created a cube off of it. The cube shows data for the "all" level correctly but on drill down it doesn't show all the data. I.E There are amount showing under "all" level but on drill down no detail is shown. See the attached image. Row 3 &5 is what I am referring too and the others don't appear to cross cast.  Is this a problem with the schema? I have checked the data in the tables and it looks correct. Any ideas of where to look?

thanks

Environment ubuntu 18.04, tomcat7 knowage6.2.1
in OLAP and What-If by (1.0k points)
retagged by
<Schema name="QuoteCube">
  <Parameter name="company" type="String" modifiable="true">
  </Parameter>
  <Parameter name="brand" description="Brand" type="String" modifiable="true">
  </Parameter>
  <Dimension type="StandardDimension" visible="true" highCardinality="false" name="Brand">
    <Hierarchy name="Brand" visible="true" hasAll="true" allMemberName="All" primaryKey="id">
      <Table name="branddim">
      </Table>
      <Level name="Brand" visible="true" table="branddim" column="brand" ordinalColumn="id" type="String" uniqueMembers="true" levelType="Regular" hideMemberIf="Never">
      </Level>
    </Hierarchy>
  </Dimension>
  <Dimension type="StandardDimension" visible="true" highCardinality="false" name="Company">
    <Hierarchy visible="true" hasAll="true" allMemberName="All" primaryKey="id">
      <Table name="companydim">
      </Table>
      <Level name="company" visible="true" table="companydim" column="company" type="String" uniqueMembers="true" levelType="Regular" hideMemberIf="Never">
      </Level>
    </Hierarchy>
  </Dimension>
  <Dimension type="StandardDimension" visible="true" highCardinality="false" name="Currency">
    <Hierarchy visible="true" hasAll="true" allMemberName="All" primaryKey="id">
      <Table name="currencydim">
      </Table>
      <Level name="Currency" visible="true" table="currencydim" column="currency" type="String" uniqueMembers="true" levelType="Regular" hideMemberIf="Never">
      </Level>
    </Hierarchy>
  </Dimension>
  <Dimension type="StandardDimension" visible="true" highCardinality="false" name="Customer">
    <Hierarchy visible="true" hasAll="true" allMemberName="All" primaryKey="id">
      <Table name="customerdim">
      </Table>
      <Level name="customer" visible="true" table="customerdim" column="customer" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
      </Level>
    </Hierarchy>
  </Dimension>
  <Dimension type="StandardDimension" visible="true" highCardinality="false" name="Domain">
    <Hierarchy visible="true" hasAll="true" allMemberName="All" primaryKey="id">
      <Table name="domaindim">
      </Table>
      <Level name="Top Level Domain" visible="true" table="domaindim" column="tld" type="String" uniqueMembers="true" levelType="Regular" hideMemberIf="Never">
      </Level>
      <Level name="Second Level Domain" visible="true" table="domaindim" column="stld" type="String" uniqueMembers="true" levelType="Regular" hideMemberIf="Never">
      </Level>
      <Level name="Domain" visible="true" table="domaindim" column="domain" type="String" uniqueMembers="true" levelType="Regular" hideMemberIf="Never">
      </Level>
    </Hierarchy>
  </Dimension>
  <Dimension type="StandardDimension" visible="true" highCardinality="false" name="ProductService">
    <Hierarchy visible="true" hasAll="true" allMemberName="All" primaryKey="id">
      <Table name="itemdim">
      </Table>
      <Level name="Item Group" visible="true" table="itemdim" column="itemgroup" type="String" uniqueMembers="true" levelType="Regular" hideMemberIf="Never">
      </Level>
      <Level name="Item" visible="true" table="itemdim" column="item" type="String" uniqueMembers="true" levelType="Regular" hideMemberIf="Never">
      </Level>
    </Hierarchy>
  </Dimension>
  <Dimension type="StandardDimension" visible="true" highCardinality="false" name="Location">
    <Hierarchy name="location" visible="true" hasAll="true" allMemberName="All" primaryKey="id">
      <Table name="locationdim">
      </Table>
      <Level name="City" visible="true" table="locationdim" column="city" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
      </Level>
      <Level name="Suburb" visible="true" table="locationdim" column="suburb" type="String" uniqueMembers="true" levelType="Regular" hideMemberIf="Never">
      </Level>
    </Hierarchy>
  </Dimension>
  <Dimension type="StandardDimension" visible="true" highCardinality="false" name="Status">
    <Hierarchy visible="true" hasAll="true" allMemberName="All" primaryKey="id">
      <Table name="quotestatusdim">
      </Table>
      <Level name="Status" visible="true" table="quotestatusdim" column="status" type="String" uniqueMembers="true" levelType="Regular" hideMemberIf="Never">
      </Level>
    </Hierarchy>
  </Dimension>
  <Dimension type="TimeDimension" visible="true" highCardinality="false" name="TDate" description="Transaction Date">
    <Hierarchy name="default" visible="true" hasAll="true" allMemberName="All">
      <Table name="transactiondatedim">
      </Table>
      <Level name="Year" visible="true" table="transactiondatedim" column="year0" type="Integer" uniqueMembers="true" levelType="TimeYears" hideMemberIf="Never">
      </Level>
      <Level name="Quarter" visible="true" table="transactiondatedim" column="quarter" type="Integer" uniqueMembers="true" levelType="TimeQuarters" hideMemberIf="Never">
      </Level>
      <Level name="Month" visible="true" table="transactiondatedim" column="month0" uniqueMembers="false" levelType="TimeMonths">
      </Level>
    </Hierarchy>
    <Hierarchy name="FinYear" visible="true" hasAll="true" allMemberName="All" description="Financial Year">
      <Table name="transactiondatedim">
      </Table>
      <Level name="FinYear" visible="true" table="transactiondatedim" column="finyear" type="Integer" uniqueMembers="true" levelType="TimeYears" hideMemberIf="Never">
      </Level>
    </Hierarchy>
  </Dimension>
  <Dimension type="StandardDimension" visible="true" highCardinality="false" name="QuoteNo">
    <Hierarchy name="default" visible="true" hasAll="true">
      <Table name="quotenodim">
      </Table>
      <Level name="QuoteNo" visible="true" table="quotenodim" column="quoteno" type="Integer" uniqueMembers="true" levelType="Regular" hideMemberIf="Never">
      </Level>
    </Hierarchy>
  </Dimension>
  <Cube name="QuoteFact" visible="true" cache="true" enabled="true">
    <Table name="quotefact">
    </Table>
    <DimensionUsage source="Brand" name="Brand" visible="true" foreignKey="brand_id" highCardinality="false">
    </DimensionUsage>
    <DimensionUsage source="Company" name="Company" visible="true" foreignKey="company_id" highCardinality="false">
    </DimensionUsage>
    <DimensionUsage source="Currency" name="Currency" visible="true" foreignKey="currency_id" highCardinality="false">
    </DimensionUsage>
    <DimensionUsage source="Customer" name="Customer" visible="true" foreignKey="customer_id" highCardinality="false">
    </DimensionUsage>
    <DimensionUsage source="Domain" name="Domain" visible="true" foreignKey="domain_id" highCardinality="false">
    </DimensionUsage>
    <DimensionUsage source="ProductService" name="ProductService" visible="true" foreignKey="item_id" highCardinality="false">
    </DimensionUsage>
    <DimensionUsage source="Location" name="Location" visible="true" foreignKey="location_id" highCardinality="false">
    </DimensionUsage>
    <DimensionUsage source="QuoteNo" name="Quote" visible="true" foreignKey="quoteno_id" highCardinality="false">
    </DimensionUsage>
    <DimensionUsage source="Status" name="Status" visible="true" foreignKey="quotestatus_id" highCardinality="false">
    </DimensionUsage>
    <DimensionUsage source="TDate" name="TDate" visible="true" foreignKey="transactiondate_id" highCardinality="false">
    </DimensionUsage>
    <Measure name="Qty" column="qty" datatype="Integer" formatString="#,###" aggregator="sum">
    </Measure>
    <Measure name="RptAmount" column="rptamount" datatype="Numeric" formatString="##,###" aggregator="sum" description="ReportingAmount" visible="true">
    </Measure>
    <Measure name="SrcAmount" column="srcamount" datatype="Numeric" formatString="##,###" aggregator="sum" description="Source Amount" visible="true">
    </Measure>
  </Cube>
</Schema>
Hi, are you sure about the uniqueMembers="true" in your TimeDimension? What happens if you set them to "false"?
i change the uniqueMembes to false but the results are the same. thanks for the suggestion.
Hm. How about adding a primaryKey attribute to all of your hierarchies where you don't reference the connection explicitly, like primaryKey="transactiondate_id" (or whatever it is called) in your time dimension hierarchy?
:) I just find this out too and came to post the solution. I debugged it by enabling 'DEBUG" log in knowagewhatif/WEB-INF/classes/log4j.properties and then searching for "modrian.sql" in the log. I could see that the join was wrong.

Thanks for your help!

1 Answer

0 votes

see schipko answer above. The primary key on the dimension hierarchies was not specified so mondrian join on the incorrect column when generating it sql queries. Not sure how it chose the column that it did instead of the primary key but its all fixed  now.

by (1.0k points)
...