[Mondrian] <Query> element inside <Hierarchy> not working - mondrian version 3.0.3.11016

Radha Ranjan Madhaw RMadhaw at facetime.com
Mon May 19 09:46:16 EDT 2008


Hi,

 

I've the following Dimension definition:

 

<Dimension name="DimUsers">

            <Hierarchy hasAll="true" primaryKey="id">

                        <Query>

                                    <SQL dialect="generic">

select "ug"."id" as "id", "ug"."userid" "userid", "u"."fullname"
"fullname", "ug"."groupid" "groupid", "g"."groupname" "groupname"

from "user_group" as "ug", "users" as "u", "groups" as "g"

where "ug"."userid"  = "u"."userid"

and   "ug"."groupid" = "g"."groupid"

                                    </SQL>

                        </Query>

                        <Level name="User Name" column="fullname"
type="String" uniqueMembers="false"/>

                        <Level name="Group Name" column="groupname"
type="String" uniqueMembers="false"/>

            </Hierarchy>

</Dimension>

 

...and using it in cube MondrianTest as following...

 

<DimensionUsage name="DimUsers" source="DimUsers"
foreignKey="user_groupid"/>

 

user_groupid is the foreign key present in the fact table
'fact_url_hits' of cube MondrianTest. 

 

When I execute the MDX query:

 

SELECT {[Measures].[URL Hits]} ON COLUMNS, NON EMPTY
{[Time].[2008].Children} ON ROWS FROM [MondrianTest] WHERE
[DimUsers].[Group Name].[group5]

 

I get the following exception:

 

Caused by: mondrian.olap.MondrianException: Mondrian Error:MDX object
'[DimUsers].[Group Name].[group5]' not found in cube 'MondrianTest'

      at
mondrian.resource.MondrianResource$_Def1.ex(MondrianResource.java:807)

      at mondrian.olap.Util.lookup(Util.java:766)

      at mondrian.olap.Id.accept(Id.java:105)

      at mondrian.olap.Query$StackValidator.validate(Query.java:1245)

      at mondrian.olap.QueryAxis.validate(QueryAxis.java:269)

      at mondrian.olap.Query.resolve(Query.java:567)

      at mondrian.olap.Query.resolve(Query.java:413)

      at mondrian.olap.Query.<init>(Query.java:217)

      at mondrian.olap.Query.<init>(Query.java:177)

      at mondrian.olap.Parser.makeQuery(Parser.java:860)

      at
mondrian.olap.CUP$Parser$actions.CUP$Parser$do_action(Parser.java:1693)

      at mondrian.olap.Parser.do_action(Parser.java:694)

      at java_cup.runtime.lr_parser.parse(lr_parser.java:569)

      at mondrian.olap.Parser.parseInternal(Parser.java:764)

      ... 7 more 

 

I hope that the structure and position of <Query> element are correct as
I've followed the Foodmart.xml sample.

 

Not able to understand why I'm getting the error that the object
[DimUsers].[Group Name].[group5] is not found in the cube.

Any help will be appreciated.

 

Thanks,

Madhav

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20080519/c0cb871d/attachment.html 


More information about the Mondrian mailing list