I have a problem that's really killing me. BTW I am new to Mdx and using olap4j Api to construct MDX Query. My problem is with the root element, Following is the code snippet:
Query myQuery = new Query("Generated Query", sales); // where sales is an object of type cube.
QueryDimension productDimension = myQuery.getDimension("Product");
So now I have an object with dimension Product to use. I want some thing like this [Product].[All Products]
to be part of the MdxQuery when I add productDimension
to an axis. I can hardcode [All Products]
but if the dimensionName passed is other than Product, say Stores it would be an issue. SO what I want is, whether it would be possible to fetch some thing get the names like [All Products] or [All Stores] or [definite Measures] which is equivalent to [All Measures] dynamically using olap4j?
PS: This is a method which takes in a dimension name and returns the first Member of the dimension like [Product].[All Products] if product is passed or [Measures].[All Measures/some Measures] if measures are passed.