开发者

Create member with description in MDX

This is a pretty straight forward question that may or may not be possible but, when you create a measure in a SSAS 2005 cube, there is a descriptio开发者_StackOverflow社区n property which can be set, which we've been using in the client application that consumes the cube.

Is it possible to set this description when you create a calculated member through MDX? i.e. something like (although it doesn't work as I get an error saying the syntax near DESCRIPTION is incorrect)

CREATE MEMBER CURRENTCUBE.[Measures].[CalculatedMember] AS
NULL,
FORMAT_STRING = "Percent",
VISIBLE = 1,
DESCRIPTION = "My favourite calcuated measure";


On the Calculations Tab - click on the 'Calculations Properties' button. This is where you can tell SSAS which folder to put your calculations in. There is a Description column - fill that in, and Bob is your uncle.


http://msdn.microsoft.com/en-us/library/ms144787.aspx

The property you are looking for is CAPTION:

CREATE MEMBER CURRENTCUBE.MEASURES.[Test Measure] 
 AS 1, 
CAPTION = 'My testing measure'; 


As in SSAS 2005 there isn't the CAPTION property, if you must have a caption I could suggest a workaround to try:

Create the member you want, name it as you want and give it the description you want. It doesn't matter what you base it on, but get it as close to the actual desired output as you can.

So, if you create [Measures].[Test] in the cube designer, with "Test Measure" as the description, then you can use SCOPE to overwrite the cell contents with your own calculation at evaluation time:

SCOPE([Measures].[Test]);
 THIS = [Measures].[A] + [Measures].[B];
END SCOPE;

So copy and paste the above into your calculations tab in SSAS designer, note that you will have to go into script view as opposed to form view.

Hopefully you will now have a measure that performs as you want, with the caption that you want. Figuring out the non-empty and getting that all correct may be another story...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜