SSAS: Create/Deploy MDX cube script with <text> - links/includes

Topics: Resolved
Mar 4, 2009 at 11:52 AM
Development Suggestion for BIDS Helper

Current Situation
With larger or more complex SSAS projects, the MDX cube script becomes quite large. Maintaining and extending  such a ten-thousands of line script becomes quite painful.

Get Organized
It would be more efficient, if the script could be split into several mdx textfiles, which could be edited in any mdx/text-editor. The main cube script then only contains general code like 'CALCULATE;' and references to external mdx textfiles using xml-like XINCLUDE/XLINK tags. The resulting overall script is either merged dynamically when opening the BIDS script view and/or are resolved at the time of script deployment.

Possible Implementation
As it seems, that direct manipulation of the cube BIDS XML-code in the <Text> .. </Text> section (= cube script) does not allow placing XML includes/links, a new feature in BIDS helper may open the door, by supporting preliminary resolution of specific script tags for text-includes
prior script deployment.

This new functionality would be very helpful in managing and developing larger MDX cube scripts.
(On the other hand, it would be great if Microsoft would support 'includes' with future releases of SSAS automatically...)
Mar 5, 2009 at 4:28 AM
Agreed that multi-user and large MDX script development is difficult. I would definitely add a feature request at

My main concern about your suggestion is that we don't want BIDS Helper to make changes to a project which prevent people without BIDS Helper from developing that solution going forward. The changes you mention there would do that.

If you have a ten-thousand line MDX script, I suspect you are creating MTD, QTD, YTD versions of each measure. Is that the case? If so, a more elegant way (and it also results in a shorter MDX script) to do that is to add calculated members to the Date dimension or add a DateTool dimension like this:
Marked as answer by furmangg on 3/17/2015 at 5:51 PM
Mar 5, 2009 at 9:01 AM
Thank you for your anwer.

Yes, I absolutely agree with your concerns that project changes should not require BIDS Helper as mandatory add-in and therefore this issue should be solved within SSAS itself. According to your recommendation, I've added my comment to a similar request within MS-Connect at

The size of the script is the result of having many calculated members and scope definitions for real members with assigned calculations. These items represent various tuple values, which support easy creation of standard financial reports with a single pivot column dimension (Actual_YTD, Budget_YTD, DiffAmt_Actual_Budget_YTD, etc.). Currently my script provides more than 200 predefined comparisons (incl. currency impact calculation).

Date aggregations itself are important. They are already added as shadow dimension just representing the collection of different date related aggregates. The functionality of date relation / date series is also already added by its own shadow dimensions respectively.

Mar 5, 2009 at 11:51 PM
This does not meet your need of splitting the script out into separate files, but in the XMLA you can actually define multiple Command elements inside the MDXScript block.

However, while you can add multiple Command elements if you edit the cube in BIDS it will load them all and merge them together into one when you save any changes. So this capability is really only useful if you are generating your MDX Script (PerformancePoint - Planning uses this technique)

Very early in the SSAS 2005 beta I thought they did have the ability to edit Commands independantly so we may see a return of this feature at some point in the future. It would ar least make it easier to work with large scripts in the editor although the cube may still be a little slow to load. I do not believe there are any hooks in BIDS that would let us implement this sort of functionality, I think Microsoft would have to do it.
Apr 18, 2014 at 3:39 PM
Llast week I published the MDX script injection projects in codepelx.

The MDX script can be easily updated or extended with code without the need
to deploy the cube again. This can be very useful when MDX script will
dynamically expand to for e.g.
  • update cube side SETs
  • generate SETs from external data source like SQL querys or XML content
  • create dynamic CALUCALATE MEMBER
  • update whole section in MDX script
Marked as answer by furmangg on 3/17/2015 at 5:50 PM