Reading Analysis Services SQL metadata

I have a number of objects in my SSAS cube, many of which were created for invisibility. For instance:

CREATE MEMBER CURRENTCUBE.[Measures].[Latency Backcolor]
AS CASE
  WHEN [Average Latency] > [Web Alert] THEN 6384849
  WHEN [Average Latency] > [Web Warn] THEN 4577517
  ELSE IIF ( [measures].[Query count] > NULL, 14876123, null)
END, VISIBLE = 0;

which is not displayed and:

CREATE MEMBER CURRENTCUBE.[Measures].[Average Latency]
 AS IIF ([Measures].[Query Count] > 0, [Measures].[Total Ms] / [Measures].[Query Count], null),
      FORMAT_STRING = "#,##0.00000;-#,##0.00000",
      BACK_COLOR = [Latency Backcolor],
      VISIBLE = 1,
      DISPLAY_FOLDER = 'Overall',
      ASSOCIATED_MEASURE_GROUP = 'Fact Raw FD';

which is.

I tried two methods for polling a cube. Use a namespace first Microsoft.AnalysisServices.AdomdClient. For instance:

using Microsoft.AnalysisServices.AdomdClient;

var _connection = new AdomdConnection
{
    ConnectionString = "Data Source=localhost;User ID=me;Password=secret;Initial Catalog=dbname",
    ShowHiddenObjects = true
};

_connection.Open();

CubeDef _cube = _connection.Cubes["MyCube"];

// _cube.Measures

I also tried the namespace Microsoft.AnalysisServices. For instance:

using Microsoft.AnalysisServices;

Server server = new Server();
server.Connect( "Data Source=localhost;User ID=me;Password=secret" );

Database database = server.Databases.GetByName( "dbname" );

Cube cube = database.Cubes.FindByName( "MyCube" );

// cube.Dimensions
// cube.MeasureGroups[].Measures

( ). , , "" , "". MDX, , . () , , . , .

!

+5
1

, ADOMD. XML/A XML.

, , Perspectives, . , Perspectives . , ADOMD , Perspective.

+2

All Articles