MDX Query Generation

2 posts, 0 answers
  1. Stephen
    Stephen avatar
    11 posts
    Member since:
    Sep 2010

    Posted 03 Mar Link to this post

    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? 

     

  2. Polya
    Admin
    Polya avatar
    239 posts

    Posted 08 Mar Link to this post

    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.
Back to Top