Note that there are some explanatory texts on larger screens.

plurals
  1. POReading SQL Analysis Services Metadata
    primarykey
    data
    text
    <p>I have a number of objects in my SSAS cube, many of which were created to be invisible. For example:</p> <pre><code>CREATE MEMBER CURRENTCUBE.[Measures].[Latency Backcolor] AS CASE WHEN [Average Latency] &gt; [Web Alert] THEN 6384849 WHEN [Average Latency] &gt; [Web Warn] THEN 4577517 ELSE IIF ( [measures].[Query count] &gt; NULL, 14876123, null) END, VISIBLE = 0; </code></pre> <p>which is <em>not</em> visible and:</p> <pre><code>CREATE MEMBER CURRENTCUBE.[Measures].[Average Latency] AS IIF ([Measures].[Query Count] &gt; 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'; </code></pre> <p>which <em>is</em>.</p> <p>I've tried two methods for interrogating the cube. First, using the <code>Microsoft.AnalysisServices.AdomdClient</code> namespace. For example:</p> <pre><code>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 </code></pre> <p>I've also tried the <code>Microsoft.AnalysisServices</code> namespace. For example:</p> <pre><code>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 </code></pre> <p>All of the above is taken directly from working code (though reduced to the bare minimum for the purposes of asking the question). Everything works perfectly with either code, with the single exception that I can't "see" any of my hidden objects, such as Measures. I <em>could</em> use the raw MDX which I can retrieve from the database using the second technique. The (seriously) down side is I'd have to parse it myself which would be a real buzz-kill. There's <em>got</em> to be a way to get to the actual objects without having to jump through so many hoops.</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload