通过AMO向计算成员添加翻译

时间:2011-01-16 13:37:20

标签: sql-server-2008 olap cube ssas

我正在使用AMO以编程方式生成OLAP多维数据集。如何为计算成员添加翻译? (SQL Server 2008)

我尝试过如下操作,但它不起作用:

MdxScript mdx = cube.MdxScripts[0];
CalculationProperty calculation = new CalculationProperty();
calculation.CalculationReference = "[Calculated measureName]";
calculation.CalculationType = CalculationType.Member;
Translation translation = new Translation();
translation.Caption = "Some Caption";
translation.Language = "Language Code";
calculation.Translations.Add(translation);
mdx.CalculationProperties.Add(calculation);

1 个答案:

答案 0 :(得分:1)

我在上面的代码中发现了问题,CalculationReference属性应设置为“[Measures]。[Calculated measureName]”。