Skip to content

Latest commit

 

History

History
91 lines (78 loc) · 3.08 KB

access-mdx-query.md

File metadata and controls

91 lines (78 loc) · 3.08 KB
title page_title description previous_url slug tags component type res_type
Access MDX Query in the PivotGrid
Access MDX Query in the PivotGrid - jQuery PivotGrid
Learn how to access a MultiDimensional eXpressions (MDS) query in a Kendo UI PivotGrid component.
/controls/data-management/pivotgrid/how-to/access-mdx-query, /controls/data-management/pivotgrid/how-to/dimensions/access-mdx-query
howto_access_mdx_query_pivotgrid
kendoui, pivotgrid, access, mdx, query
pivotgrid
how-to
kb

Environment

Product Progress® Kendo UI® PivotGrid for jQuery
Operating System Windows 10 64bit
Browser Google Chrome
Browser Version 61.0.3163.100

Description

How can I override the DataSource generated query in a Kendo UI PivotGrid?

Solution

To achieve this behavior, access the generated MDX Query, as demonstrated in the following example.

<div id="example">
    <div id="pivotgrid"></div>

    <script>
        $(document).ready(function () {
            var pivotgrid = $("#pivotgrid").kendoPivotGrid({
                filterable: true,
                columnWidth: 200,
                height: 580,
                dataSource: {
                    type: "xmla",
                    columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Product].[Category]" } ],
                    rows: [{ name: "[Geography].[City]" }],
                    measures: ["[Measures].[Internet Sales Amount]"],
                    transport: {
                        connection: {
                            catalog: "Adventure Works DW 2008R2",
                            cube: "Adventure Works"
                        },
                        read: "https://demos.telerik.com/olap/msmdpump.dll",
                      parameterMap: function(options, type) {
                        var query = kendo.data.transports.xmla.fn.options.parameterMap(options, type);

                        //Modify the query here if needed.

                        return query;
                      }
                    },
                    schema: {
                        type: "xmla"
                    },
                    error: function (e) {
                        alert("error: " + kendo.stringify(e.errors[0]));
                    }
                }
            }).data("kendoPivotGrid");
        });
    </script>
</div>

See Also

  • JavaScript API Reference of the jQuery PivotGrid
  • [Change the Data Source of the PivotGrid Dynamically]({% slug howto_change_datasource_dynamically_pivotgrid %})
  • [Drill Down Navigation Always Starting from PivotGrid Root Tuple]({% slug howto_drill_down_navigation_startingfrom_root_tuple_pivotgrid %})
  • [Expand Multiple PivotGrid Column Dimensions]({% slug howto_expand_multiple_column_dimensions_pivotgrid %})
  • [Filter PivotGrid by Using the include Operator]({% slug howto_use_include_operator_pivotgrid %})