简体   繁体   English

Pentaho Mondrian-Java程序中的Olap深入分析

[英]Pentaho Mondrian - Olap drilldown in java program

I'm using Mondrian 3.4 as the Olap Server to my application written in Java. 我将Mondrian 3.4用作以Java编写的应用程序的Olap Server。 Currently i wanted to perform some typical Olap operations in a cube, but i could't find any pointers that guided me to how to perform a drilldown operation in a cube with Mondrian. 目前,我想在多维数据集中执行一些典型的Olap操作,但是找不到任何指导我如何在Mondrian的多维数据集中执行向下钻取操作的指针。 I could't find methods in the Mondrian API to do this. 我在Mondrian API中找不到方法来执行此操作。 Is this possible? 这可能吗? How should i do it? 我该怎么办?

Thks in advance. 提前。

I think you can check MDDataSet_Tabular inner class within mondrian.xmla.XmlaHandler , it provides API functions to store dimension values and names into MDDataSet object when you perform drilldown operation. 我认为您可以在mondrian.xmla.XmlaHandler检查MDDataSet_Tabular内部类,它提供API函数,以在执行向下钻取操作时将维值和名称存储到MDDataSet对象中。 I'm using Mondrian 3.1, but I think the source code should be the same in 3.4. 我使用的是Mondrian 3.1,但我认为源代码应该与3.4中的相同。

If you have additional problem, please let me know.. Good luck 如果您还有其他问题,请告诉我。

There are two ways to do a drilldown. 有两种方法可以进行追溯。 You can either get a drilldown a MDX query, or a drilldown of a particular cell. 您可以对MDX查询进行深入钻取,也可以对特定单元格进行深入钻取。

To run a drilldown query, in olap4j, you do: 要运行深入查询,请在olap4j中执行以下操作:

ResultSet rs =
    olapConnection.createStatement().executeQuery(
        "DRILLTHROUGH\n"
        + "SELECT {[Measures].[Unit Sales]} on columns\n"
        + "from [Sales]\n"
        + "where ([Promotions].[One Day Sale],\n"
        + " [Store].[Store City].[Walla Walla],\n"
        + " [Product].[Product Category].[Bread])\n"
        + "RETURN [Customers].[Name], [Gender].[Gender]");

The RETURN clause is optional and specifies which fields you want returned. RETURN子句是可选的,它指定要返回的字段。 To drilldown on a particular cell, you run a query, access the cell you want and call: 要下钻特定单元格,请运行查询,访问所需的单元格并调用:

org.olap4j.Cell.drillthrough()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM