2

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 description 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";
Josh Gallagher
  • 5,211
  • 2
  • 33
  • 60
Dan Kennedy
  • 800
  • 1
  • 6
  • 13

3 Answers3

2

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.

Jake Longo
  • 29
  • 2
1

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'; 
Meff
  • 5,889
  • 27
  • 36
1

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...

Meff
  • 5,889
  • 27
  • 36
  • Meff, Again, thanks for the post but this doesn't achieve what we need. Basically the problem is the description of a measure is being used in the client app to provide a tooltip for the measure. what you've described here will create me another measure with the value of two other measures combined, leaving the other as it was. I think I've come to the conclusion that it's simply not possible and will have to look at a place to store the measure metadata outside the cube itself. – Dan Kennedy Apr 22 '10 at 12:21
  • @Dan-Kennedy The SCOPE statement allows you to redefine the measure as it is evaluated - You create a measure with the correct description (MetaData) in the designer as normal then use your own calculation to redefine what the output should be. The example above was just an example of syntax, I believe you can achieve what you want, and I believe my approach will work, if I haven't explained it properly do just give it a try. In my example above, the "[Measures].[A] + [Measures].[B];" should be replaced with your real MDX, then you have both calculation and description? – Meff Apr 22 '10 at 16:04