[Mondrian] Mondrian output as a JSON file

Andy Grohe agrohe21 at gmail.com
Fri Mar 9 08:45:54 EST 2012


You might try xmla4js
http://code.google.com/p/xmla4js/

Or saiku
http://analytical-labs.com/
 On Mar 8, 2012 11:55 PM, "Shehzad Ahmad Hashmi" <s.hashmi44 at gmail.com>
wrote:

> Hi!
> I am new to Mondrian. I am using it in my project for OLAP operations. I
> am testing it with Foodmart database. The problem is that I need the OLAP
> operations results in JSON format. I know that mondrian has the same
> structure as JSON in the form of hierarchies. I want to generate a JSON
> file as an output from the result of mondrian MDX query. The result should
> be similar to OLAP operations. I don't know how to parse the result
> generated from MDX query. Please help me as I have to use it in my FYP.
> Thanks.
> Here is the code.
>
>   String connStr =  "Provider=mondrian;" +
>                  "Catalog=/WEB-INF/FoodMart.xml;" +
>                  "JdbcDrivers=com.mysql.jdbc.Driver;" +
>                  "Jdbc=jdbc:mysql://localhost/foodmart;" +
>                  "jdbcUser=root;" +
>                  "jdbcPassword=;";
>
>         String queryStr ="select {[Measures].[Unit Sales],
> [Measures].[Store Cost], [Measures].[Store Sales]} ON COLUMNS,"+
>          "Crossjoin(Hierarchize(Union({[Promotion Media].[All Media]},
> [Promotion Media].[All Media].Children)), {[Product].[All Products]})
>                                   ON ROWS"+
>          " from [Sales]"+
>          "where [Time].[1997]";
>
>         Connection connection = DriverManager.getConnection(connStr, null);
>         Query query = connection.parseQuery(queryStr);
>         Result result = connection.execute(query);
>         result.print(new PrintWriter(System.out));
>
>
>
> _______________________________________________
> Mondrian mailing list
> Mondrian at pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20120309/478d3649/attachment.html 


More information about the Mondrian mailing list