Home Dashboard Directory Help
Search

Cannot hide the calculated Measures of cube using AMO method.? by Anil Maharjan


Status: 

Active


1
0
Sign in
to vote
Type: Suggestion
ID: 793936
Opened: 7/14/2013 10:19:15 PM
Access Restriction: Public
0
Workaround(s)
view

Description

Hi,
I have listed the calculated Measures of cube using AMO code and now all I want is to hide some of these calculated Measures but while researching some post I found that we can’t hide the calculated Measures using AMO .

https://connect.microsoft.com/SQLServer/feedback/details/252730/microsoft-analysisservices-design-scripts

I tried to coded as below to hide logic but it doesn't work since there is no any object define in AMO for calculated measures if I am not wrong.:

foreach (MdxScript script in cube.MdxScripts)
{
foreach (CalculationProperty cp in script.CalculationProperties)
{
if (cp.CalculationReference == CalMeasureName)
//CalMeasureName is a one of calculated Measure name define in cube.
{
cp.Visible = false;
// this.cube.MdxScripts.FindByName(cp.CalculationReference).Update();
script.Update();
Cube cb = this.cube;
cb.Update(UpdateOptions.ExpandFull);
}
}
But the scripts doesn't work since as per Microsoft calculated Measures are not treat as AMO objects and we couldn't simply set the properties to hide the calculated Measures.

Hope this feature will be included in next release version if possible or is there some an alternative way.

Thanks,
Anil Maharajan
Details
Sign in to post a comment.
Sign in to post a workaround.