#34 Add Cell.getContextMdx()

olap4j-2.0
open
nobody
None
1
2013-10-03
2013-10-03
No

We need a smarter way to generate the MDX specific to a given cell.

The documentation must be updated for Cell.drillThrough and reference Statement.executeQuery.

The API will be:

  • Cell.getContextMdx()

The implementation is somewhat like this:

StringBuffer buf = new StringBuffer();
buf.append("SELECT (");
for (int i = 0; i < cellPosition.size(); i++) {
List<Member> members =
cs.getAxes().get(i).getPositions().get(cellPosition.get(i)).getMembers();
for (int k = 0; k < members.size(); k++) {
Member m = members.get(k);
if (k > 0 || i > 0) {
buf.append(", ");
}
buf.append(m.getUniqueName());
}
}
buf.append(") ON COLUMNS \r\n");
buf.append("FROM " + cube.getCubeName() + "\r\n");

Discussion


Log in to post a comment.