0
votes

I'm trying to get a Level member or value in Mondrian through Java code. Is there any way to do this?

I can take schema, hierarchy, dimension, and level through the getter Mondrian has, but unfortunately I can't find a way to access the value/member for each level.

For example in FoodMart schema,

Dimension: Store

Level: Store City

value/member: CA/WA/NY/ etc.

Thanks!

1

1 Answers

2
votes

What you are looking for is the .Members method on Level elements. The Database Journal has a very good series of articles on MDX where all these things are explained simply and geared towards new comers to MDX.

Using Java & Mondrian, this is done through the olap4j API. You can use:

org.olap4j.metadata.Level.getMembers()

For more details on olap4j, you can consult the API online. If you need help getting started using olap4j, you should go through the introductory guide.