You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given the following FoodMart MDX statement executed with OLAP4J/Mondrian, I'm expecting the column headers to return N members for each position according to the hierarchy. Instead, it returns a single member (the bottom one). In the case of [Store State], I'm expecting two members, for example 'Canada' and 'BC', instead position.getMembers only returns 'BC'.
Is there anything wrong in the way the axes are printed?
Code in Scala:
val select = "SELECT " +
"[Measures].[Count] ON ROWS, " +
"[Store].[Store State].Members ON COLUMNS " +
"FROM [HR] "
val olapConnection = pool.getConnection
val statement = olapConnection.createStatement
val cellSet = statement.executeOlapQuery(select)
printCellSet(cellSet)
pool.close(olapConnection)
......
......
def printCellSet (cellSet: CellSet) = {
val cellSetAxes = cellSet.getAxes.asScala
val columnsAxis = cellSetAxes(Axis.COLUMNS.axisOrdinal)
for ( colPosition <- columnsAxis.getPositions.asScala) yield {
val members = colPosition.getMembers.asScala
println(members)
}
var cellOrdinal = 0
val rowsAxis = cellSetAxes(Axis.ROWS.axisOrdinal)
for ( rowPosition <- rowsAxis.getPositions.asScala) yield {
val members = rowPosition.getMembers.asScala
println(members)
// for each row, loop through every column to get the cell value
for ( colPosition <- columnsAxis.getPositions.asScala) yield {
val cell = cellSet.getCell(cellOrdinal)
cellOrdinal = cellOrdinal + 1
println(cell.getFormattedValue)
}
}
}
The text was updated successfully, but these errors were encountered:
Given the following FoodMart MDX statement executed with OLAP4J/Mondrian, I'm expecting the column headers to return N members for each position according to the hierarchy. Instead, it returns a single member (the bottom one). In the case of [Store State], I'm expecting two members, for example 'Canada' and 'BC', instead
position.getMembers
only returns 'BC'.Is there anything wrong in the way the axes are printed?
Code in Scala:
The text was updated successfully, but these errors were encountered: