This is a migrated thread and some comments may be shown as answers.

MDX Query Generation

1 Answer 76 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 03 Mar 2017, 04:32 PM

Hi, 

Is it possible to change the way that MDX is generated by the PivotGrid when filters are applied? 

Currently when I apply a Month filter in my time dimension for e.g., this is done by adding the filter value as a sub-cube query in the from clause, rather than placing it in the WHERE clause. 

So instead of having 

 

SELECT x ON 0, y ON 1

FROM <cube>

WHERE ([time].[month].&[z])

 

The pivot grid generates

 

SELECT x ON 0, y ON 1
FROM (SELECT [time].[month].&[z]  FROM <cube>)

 

This is generally fine, but when we have calculated measures in the cube which rely on knowing where you are in the time hierarchy, (i.e. [time].[month].currentmember) then this distorts the calculation because the scope is handled in the sub-cube and the main query believes that [time].[month].currentmember is 'All' rather than Month Z as the query above suggests. 

 

Is there a way to tell the grid to use the former method? Failing that, how can we access the time filter from the calculations? 

 

1 Answer, 1 is accepted

Sort by
0
Polya
Telerik team
answered on 08 Mar 2017, 02:08 PM
Hi Stephen,

With the current implementation of our OlapDataProviders there is no available way to change the generated MDX queries.

In order to understand your scenario better I suggest openning a ticket and attaching a project that demonstrates your approach and custom calculated measures.

Regards,
Polya
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
PivotGrid
Asked by
Stephen
Top achievements
Rank 1
Answers by
Polya
Telerik team
Share this question
or