Articles in this section
Category / Section

How to run an MDX query with the OlapClient component

We can load OlapClient by directly passing MDX query instead of OlapReport. Please refer the below code snippet which illustrates the same.

C#

 
OlapDataManager olapDataManager = new OlapDataManager();
olapDataManager.DataProvider = dataProvider;
olapDataManager.MdxQuery = "SELECT NONEMPTY( VISUALTOTALS( ({{Drilldownlevel({ [Date].[Fiscal] })}}) ) * {[Measures].[Internet Sales Amount]}, VISUALTOTALS( ({{Drilldownlevel({ [Customer].[Customer Geography] })}}) )) dimension properties member_type, PARENT_UNIQUE_NAME ON COLUMNS , NONEMPTY( VISUALTOTALS( ({{Drilldownlevel({ [Customer].[Customer Geography] })}}) ), VISUALTOTALS( ({{Drilldownlevel({ [Date].[Fiscal] })}}) ) * {[Measures].[Internet Sales Amount]}) dimension properties member_type, PARENT_UNIQUE_NAME ON ROWS FROM [Adventure Works] CELL PROPERTIES VALUE, FORMAT_STRING, FORMATTED_VALUE";
            

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied