在 MDX 中创建具有描述的成员

发布于 2024-08-30 05:01:01 字数 354 浏览 10 评论 0原文

这是一个非常直接的问题,可能可能也可能不可能,但是,当您在 SSAS 2005 多维数据集中创建一个度量时,有一个可以设置的描述属性,我们一直在使用该属性的客户端应用程序中使用该属性。立方体。

通过 MDX 创建计算成员时是否可以设置此描述?即类似的东西(尽管它不起作用,因为我收到一条错误,说“描述”附近的语法不正确)

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

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";

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

半寸时光 2024-09-06 05:01:01

在“计算”选项卡上 - 单击“计算属性”按钮。您可以在此处告诉 SSAS 将计算放入哪个文件夹。有一个描述列 - 填写该列,鲍勃是您的叔叔。

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.

撩人痒 2024-09-06 05:01:01

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

您正在寻找的属性是 CAPTION:

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

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'; 
じее 2024-09-06 05:01:01

与 SSAS 2005 中一样,没有 CAPTION 属性,如果您必须有一个标题,我可以建议尝试一种解决方法:

创建您想要的成员,根据您的需要命名它,并为其提供您想要的描述。它基于什么并不重要,但要使其尽可能接近实际所需的输出。

因此,如果您在多维数据集设计器中创建 [Measures].[Test],并以“Test Measure”作为描述,那么您可以在评估时使用 SCOPE 用您自己的计算覆盖单元格内容:

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

因此复制并粘贴上面的内容进入 SSAS 设计器中的计算选项卡,请注意,您必须进入脚本视图而不是表单视图。

希望您现在已经有了一个可以按照您想要的方式执行的度量,并带有您想要的标题。弄清楚非空并得到所有正确可能是另一个故事......

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文