[Mondrian] How to explore the dimension object used as a measure?

Fabien Carrion fabien.carrion at gmail.com
Sat Jun 9 15:05:29 EDT 2007


Hi,

I would like to explore the Dimension object when it is used as a measure.

So I do this:

Schema schema = connection.getSchema();
Cube cubes[] = schema.getCubes();
for (int n = 0; n < cubes.length; n++) {
  if (cubes[n].getName().equals(cubeDefaultName)) {
    cube = cubes[n];
    break;
  }
}
Dimension dimensions[] = cube.getDimensions();
for (int n = 0; n < dimensions.length; n++) {
  Hierarchy hierarchy = dimensions[n].getHierarchy();
  Member member = hierarchy.getDefaultMember();
  if (dimensions[n].isMeasures()) {
    measuresMdx = "";
    columnsMdx = " select NON EMPTY {" + member.getUniqueName() + "}
ON columns, ";
  } else {
    if (rowsMdx.length() > 0) {
      rowsMdx.append(", ");
    }
  rowsMdx.append(member.getUniqueName());
  }
}
StringBuffer result = new StringBuffer(measuresMdx.length() +
columnsMdx.length() + rowsMdx.length() + 50);

result.append(measuresMdx).append(columnsMdx).append("NON EMPTY
{(").append(rowsMdx).append(")} ON rows ").append("from [" +
cube.getName() + "]");


This code just display me one measure. I don't find out where are the
other measures. How can I display them?

I am using mondrian 2.3.2.8944 in a java program.

Thanks

-- 
Fabien Carrion

()  Campagne du ruban ASCII -- Contre les mails en html
/\  contre les pieces-jointes Microsoft
Web: http://fabien.carrion.free.fr/



More information about the Mondrian mailing list