简单Olap多维数据集和简单查询MDX

简单Olap多维数据集和简单查询MDX,mdx,pentaho,olap,mondrian,Mdx,Pentaho,Olap,Mondrian,我有一个示例星型模式是这样制作的: author (id, name) book (id, name) sample_fact_table (id, authorfk, bookfk, quantity) 其中obiouvsly authorfk是对author.id的FK,bookfk是对book.id的FK 维度为:“作者”、“书籍”。量度是“量” 我使用Pentaho Schema Workbench工具对多维数据集进行了以下配置: <Schema name="MySchema"&

我有一个示例星型模式是这样制作的:

author (id, name)
book (id, name)
sample_fact_table (id, authorfk, bookfk, quantity)
其中obiouvsly authorfk是对author.id的FK,bookfk是对book.id的FK

维度为:“作者”、“书籍”。量度是“量”

我使用Pentaho Schema Workbench工具对多维数据集进行了以下配置:

<Schema name="MySchema">
  <Dimension type="StandardDimension" visible="true" name="Author">
    <Hierarchy visible="true" hasAll="true" allMemberName="All Authors" primaryKey="id">
      <Table name="author">
      </Table>
      <Level name="Name" visible="true" table="author" column="id" nameColumn="name" uniqueMembers="false">
      </Level>
    </Hierarchy>
  </Dimension>
  <Dimension type="StandardDimension" visible="true" name="Book">
    <Hierarchy visible="true" hasAll="true" allMemberName="All Books" primaryKey="id">
      <Table name="book">
      </Table>
      <Level name="Name" visible="true" table="book" column="id" nameColumn="name" uniqueMembers="false">
      </Level>
    </Hierarchy>
  </Dimension>
  <Cube name="TestCube" visible="true" cache="true" enabled="true">
    <Table name="sample_fact_table">
    </Table>
    <DimensionUsage source="Author" name="Author" visible="true" foreignKey="authorfk">
    </DimensionUsage>
    <DimensionUsage source="Book" name="Book" visible="true" foreignKey="bookfk">
    </DimensionUsage>
    <Measure name="quantity" column="quantity" aggregator="sum" visible="true">
    </Measure>
  </Cube>
</Schema>
我有一个好结果:

Axis #0:
{}
Axis #1:
{[Measures].[quantity]}
Axis #2:
{[author].[Al]}
{[author].[John]}
{[author].[Jack]}
Row #0: 3
Row #1: 9
Row #2: 1
但如果我不是问作者而是问这本书,像这样:

select 
Measures.quantity ON COLUMNS,
NON EMPTY Book.Children ON ROWS
from [TestCube]
我得到这个错误:

Mondrian Error:Failed to parse query 'select 
Measures.quantity ON COLUMNS,
NON EMPTY Book.Children ON ROWS
from [TestCube]'

Mondrian Error:MDX object 'Book' not found in cube 'TestCube'
我做错了什么

Author和Book都是维度,都以相同的方式声明,都引用到多维数据集中


谢谢大家!

如果将author从多维数据集定义中取出,并将book的定义保留在中,则book查询是否执行正常?它仍然没有执行查询,也将author去掉,从而给出该错误。我被困了几个小时,然后我在另一台计算机上用同样的数据库、同样的xml和同样的客户机工具尝试了同样的事情,结果一切正常。我仍然不知道问题出在哪里。如果您将author从多维数据集定义中取出,并将book的定义保留在中,book查询是否执行正常?它仍然没有执行查询,也将author去掉,这是一个错误。我被困了几个小时,然后我在另一台计算机上用同样的数据库、同样的xml和同样的客户机工具尝试了同样的事情,结果一切正常。我还是不知道问题出在哪里。
Mondrian Error:Failed to parse query 'select 
Measures.quantity ON COLUMNS,
NON EMPTY Book.Children ON ROWS
from [TestCube]'

Mondrian Error:MDX object 'Book' not found in cube 'TestCube'