Reputation: 1
I have a mdx query which gives me the result as shown in the attached image. I want to read the dimensions i.e column headers and row headers in from java using olap4j libraries. Using getCell method I can read the values, can anyone tell me which methods to use to read the column header and row headers.(MDX ResultTotal Sales Amount, Sunday,monday ...)
Upvotes: 0
Views: 316
Reputation: 2262
CellSet from olap4j (apart from cells) has axes (rows, columns, slicer). It looks like in your case,
You could do following to retrieve those,
CellSet cellSet = //retrieve cellset
List<CellSetAxis> axes = cellSet.getAxes(); //Gives you all axes
CellSetAxis columnAxis = axes.get(0); //Will give you column axes
CellSetAxis rowAxis = axes.get(1);
List<Position> pos = rowAxis.getPositions();
for(Position p:pos){
List<Member> members = p.getMembers();
Member m = members.get(0); //will give you Sunday
}
This will give you more detail of API.
Upvotes: 0