Skip to main content

MDX AGGREGATE FUNCTION

You can use AGGREGATE function to join the set as member. for example see the below given expression:
WITH
SET [TwoMonth] AS
{
[Order Date].[Date By Year].[Month].&[200303],
[Order Date].[Date By Year].[Month].&[200304]
}

MEMBER [Measures].[TowMonth] AS
AGGREGATE({
[Order Date].[Date By Year].[Month].&[200303],
[Order Date].[Date By Year].[Month].&[200304]
})

Now if you are using the Member expression you will get the aggregated value of two months of Order Quantity measures.

SELECT ([Order Date].[Date By Year].[TwoMonth],[Measures].[Order Quantity]) ON 0 FROM Sales
//// Output (using AWDW database) TwoMonth 9260

Verify the result, use the set [TwoMonth], you should get the same result.

SELECT ([TwoMonth],[Measures].[Order Quantity]) ON 0 FROM Sales

// Output: March 3860, April 5400

Comments

Popular posts from this blog

Report Model Deployment Using Report Manager

Once you have design the report model and build the project this is the time to deploy on production environment. Similar to Report deployment if you will specify the Report Server and the folder name where your want to deploy the project and deploy; Visual studio environment deploy the project on the report server. But in case it is not possible then have to deploy the Report model through Report Manager Web application (using upload feature of web manager). Connect to the Target server -> Open Report Manager -> Locate the folder where you want to deploy the Report Model -> Click on Upload File Button of Report Manager Locate the Report Model (.smdl) file and click Ok. It will deploy the file on the server. Wait a minute are you getting a problem “ The DataSourceView is missing for the SemanticModel ” or something it just because of data source view is not available. The data source view and report model are the xml based file so you need to merge the both file (.smdl and .ds...

Using Stored Procedure in SSIS OLEDB Source Component

Error: A rowset based on the SQL command was not returned by the OLE DB provider. Cause: Usually it happened when the usp using multiple query calls in the procedure Resolution: Write the below given code at the top of sp in OLEDB source component of SSIS and the code would be something like given below:         SET NOCOUNT ON     SET ANSI_WARNINGS OFF     EXEC <usp_Name>