简体   繁体   English

mondrian中的多重等级表示未找到等级

[英]Multiple hierarchy in mondrian says Hierarchy not found

I have following Dimension in mondrian schema. 我在mondrian模式中遵循Dimension。 Mondrian on creating connection says 蒙德里安在建立联系上说

mondrian.olap.MondrianException: Mondrian Error:Internal error: Hierarchy '[Product]' not found mondrian.olap.MondrianException:Mondrian错误:内部错误:找不到层次结构“ [产品]”

<Dimension name="Product" foreignKey="item_id">
    <Hierarchy hasAll="true" primaryKey="item_code" primaryKeyTable="m_item_master">
        <Join leftKey="item_code" rightKey="item_code">
            <Table name="m_item_master"/> <!--dummy_master--> <!--m_item_master-->
            <Table name="m_item_relation"/>
        </Join>
        <Level name="Department" table="m_item_relation" column="department"/>
        <Level name="Class" table="m_item_relation" column="category"/>
        <Level name="Item" table="m_item_master" column="item_code" ordinalColumn="item_code" nameColumn="name" uniqueMembers="true" type="Numeric"/>
    </Hierarchy>

    <Hierarchy name="Base Item" hasAll="false" primaryKey="item_code" primaryKeyTable="m_item_master">
        <Join leftKey="item_code" rightKey="item_code">
            <Table name="m_item_master"/> <!--dummy_master--> <!--m_item_master-->
            <Table name="m_item_relation"/>
        </Join>
        <Level name="Department" table="m_item_relation" column="department" captionColumn="department"/>
        <Level name="Item" table="m_item_master" column="item_code" ordinalColumn="item_code" nameColumn="name" uniqueMembers="true" captionColumn="name" type="Numeric"/>
        <Property name="Price" table="m_item_master" column="price" />
    </Hierarchy>
</Dimension>

I am using Mondrian-4.0.0-SNAPSHOT version and tried the same with latest mondrian 4.2.0.0-204 version as well. 我正在使用Mondrian-4.0.0-SNAPSHOT版本,并尝试与最新的mondrian 4.2.0.0-204版本相同。

Note: Moreover I am getting this Error during mondrian connection creation itself. 注意:此外,我在mondrian连接创建过程中遇到此错误。 So it doesn't concern with any MDX query passed to it. 因此,它与传递给它的任何MDX查询无关。

Ok. 好。 This is the what the mistake I found. 这就是我发现的错误。 For the clarification, Mondrian do support multiple hierarchy , but to the above schema we seems to have a different problem with the associated roles. 为了澄清起见, Mondrian确实支持多个层次结构 ,但是对于上述架构,我们似乎在关联角色方面存在其他问题。

<Role name="myrole">
    <SchemaGrant access="none">
        <CubeGrant cube="Transaction" access="all">
            <HierarchyGrant hierarchy="[Product]" access="custom" rollupPolicy="partial">
                <MemberGrant member="[Product].[Cottage Foods]" access="all"/>
                <MemberGrant member="[Product].[Vegetables]" access="all"/>
                ....
            </HierarchyGrant>
            ....
        </CubeGrant>
    </SchemaGrant>
</Role>

In the above role, though the default hierarchy takes the name of the dimension in mondrian, we have to specify them as [Dimension.Hierarchy] in roles but not just Hierarchy name if you have multiple hierarchy within the Dimension. 在上述角色中,尽管默认层次结构采用mondrian中的维度名称,但如果您在Dimension中具有多个层次结构,则我们必须在角色中将它们指定为[Dimension.Hierarchy],而不仅是Hierarchy名称。 In our case, it should be as below. 在我们的情况下,应如下所示。

<Role name="myrole">
    <SchemaGrant access="none">
        <CubeGrant cube="Transaction" access="all">
            <HierarchyGrant hierarchy="[Product.Product]" access="custom" rollupPolicy="partial">
                <MemberGrant member="[Product.Product].[Cottage Foods]" access="all"/>
                <MemberGrant member="[Product.Product].[Vegetables]" access="all"/>
                ....
            </HierarchyGrant>
            ....
        </CubeGrant>
    </SchemaGrant>
</Role>

This solves the above problem. 这样解决了上述问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM