Category / Section
How to run an MDX query with the OlapClient component
1 min read
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";