how to user the drillThrough in olap4j or mondrian
Open Java API for OLAP
Brought to you by:
jhyde,
lucboudreau
Hi Julian,
I want to user the mdx to drillThrough the data,then I get the error mondrian.olap.DrillThrough cannot be cast to mondrian.olap.Query
mdx string like the "DRILLTHROUGH MAXROWS 5 select {[Measures].[CallNum]} ON COLUMNS,([Model].[Model].Members) ON ROWS from [Call_Record]"
is mondrian Support DRILLTHROUGH NOW?
today I user the cell.drillThrough() to drillThrough the data,but I don't kown how to control
the the return column.
Could you give me a simple Example to let me kown how to user the olap4j or mondrian to drillThrough the data.
Forgive my poor English.
Can you attach the full call stack? What version of Mondrian?
The version of Mondrian is mondrian-3.2.1.13885.
The full call stack in the lucBoudreau's Reply.
With his help I can user DRILLTHROUGH in olap4j,but I don't know how to control the return column.
Last edit: LLoyd 2013-04-25
For examples using the RETURN clause of DRILLTHROUGH statements, take a look at the TCK code. Look at the tests that start with testDrillthroughReturnClause_X
https://github.com/olap4j/olap4j/blob/master/testsrc/org/olap4j/ConnectionTest.java#L2991
thanks for you answers.
I find that the return is Invalid in my example.
No matter how much Dimensions I used behind return,
it's always return all Dimensions that be used in mdx.
this is my code
Class.forName("mondrian.olap4j.MondrianOlap4jDriver");
Connection connection = DriverManager .getConnection("jdbc:mondrian:Jdbc=jdbc:oracle:thin:@192.168.77.65:1521:orcl;JdbcUser=;JdbcPassword=;Catalog=" + xmlPath + "/test.xml");
OlapConnection conn = (OlapConnection) ((OlapWrapper) connection)
.unwrap(OlapConnection.class);
OlapWrapper wrapper = (OlapWrapper) conn;
OlapConnection olapConnection = wrapper.unwrap(OlapConnection.class);
OlapStatement statement = olapConnection.createStatement();
String sqlText="DRILLTHROUGH MAXROWS 10 " +
"SELECT {([Measures].[CallNum])} on 0,
{([Brand].[ABC],[Bussiness].[Bussiness].[A_GPRS])} on 1 FROM [Call_Record] " +
"where ([Time].[2013].[01].[08]) " +
"return [Brand].[Brand]";
ResultSet rs=statement.executeQuery(sqlText);
while(rs.next())
{
System.out.print(rs.getString(1));
System.out.print(rs.getString(2));
System.out.print(rs.getString(3));
System.out.print(rs.getString(4));
System.out.print(rs.getString(5));
System.out.println(rs.getString(6));
}
Last edit: LLoyd 2013-04-25
Mondrian 3.2 did not support the RETURN clause. You have to use 3.4+.
Thanks for your help and patience!
The RETURN clause is useful in 3.5.
Is there API of Drillthrough?
I don't find something about Drillthrough in the mondrian's documentation.
http://mondrian.pentaho.com/documentation/configuration.php#Properties
Last edit: LLoyd 2013-04-26
The current way to perform drillthrough only works on Mondrian by calling olapConnection.createStatement().executeQuery
For XMLA support, there is a separate ticket created in this tracker.