Add translations to calculated member through AMO
I am using AMO to programmatically generate an OLAP Cube. How can I add translations for the calculated members? (SQL Server 2008)
I have tried as follows, but it does not work:
开发者_JS百科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);
I have found the problem in the code above, the CalculationReference property should be set to "[Measures].[Calculated measureName]".
精彩评论