How do I put measures in MDX query using Olap4j

496 views Asked by At

Olap4j documentation gives a good example of constructing simple MDX query:

Query myQuery = new Query("SomeArbitraryName", salesCube);

QueryDimension productDim = myQuery.getDimension("Product");
QueryDimension storeDim = myQuery.getDimension("Store");
QueryDimension timeDim = myQuery.getDimension("Time");

myQuery.getAxis(Axis.COLUMNS).addDimension(productDim);
myQuery.getAxis(Axis.ROWS).addDimension(storeDim);
myQuery.getAxis(Axis.FILTER).addDimension(timeDim);

However, there is no info how to put measure into the query.

Is there a way to do this using Olap4j API?

1

There are 1 answers

0
FrankPl On BEST ANSWER

From the point of view of MDX, there is a dimension called Measures, which has no hierarchies, but all the measures as its members. Thus, I would assume you can use this dimension like all the other dimensions and add it to the query.