{"id":144,"date":"2009-03-01T18:54:07","date_gmt":"2009-03-01T23:54:07","guid":{"rendered":"http:\/\/www.ssas-info.com\/VidasMatelisBlog\/?p=144"},"modified":"2009-03-01T18:54:07","modified_gmt":"2009-03-01T23:54:07","slug":"using-ssrs-to-report-ssas-2008-database-structure-using-dmvs","status":"publish","type":"post","link":"http:\/\/www.ssas-info.com\/VidasMatelisBlog\/144_using-ssrs-to-report-ssas-2008-database-structure-using-dmvs","title":{"rendered":"Using SSRS to report SSAS 2008 database structure using DMVs"},"content":{"rendered":"<p>New SSAS 2008 DMVs allows you to easily access Microsoft SQL Server Analysis Services (SSAS) metadata &#8211; information about cubes, dimensions, measure groups, measures, etc. As with DMVs metadata information is returned in\u00a0the data set format, it is very easy to build Reporting Services reports to generate documentation about your database.<\/p>\n<p>You can execute SSAS DMV queries directly in the Analysis Services environment, but this approach has a lot of limitations &#8211; most importantly you can not do joins between DMVs. To go around this limitation, I created linked server from SQL Server to Analysis Services. This way I can do joins between DMVs. Here is the script that was used to create linked server:<!--more--><\/p>\n<blockquote><p>EXEC master.dbo.sp_addlinkedserver<br \/>\n\u00a0\u00a0 @server = N&#8217;SSAS_Reporter&#8217;<br \/>\n\u00a0, @srvproduct=N&#8217;MSOLAP&#8217;<br \/>\n\u00a0, @provider=N&#8217;MSOLAP&#8217;<br \/>\n\u00a0, @datasrc=N&#8217;VIDAS-LENOVO&#8217;\u00a0 \/*\u00a0&lt;&lt;&lt; My\u00a0Analysis Services server name *\/<br \/>\n\u00a0, @catalog=N&#8217;Adventure Works DW 2008&#8242;\u00a0\/* &lt;&lt;&lt; My Analysis Services database name *\/<br \/>\n\u00a0go<br \/>\n\u00a0<br \/>\n&#8212; Setup security as per your environment requirements.<br \/>\nEXEC master.dbo.sp_addlinkedsrvlogin<br \/>\n\u00a0\u00a0 @rmtsrvname=N&#8217;SSAS_Reporter&#8217;<br \/>\n\u00a0, @useself=N&#8217;False&#8217;<br \/>\n\u00a0, @locallogin=NULL<br \/>\n\u00a0, @rmtuser=NULL<br \/>\n\u00a0, @rmtpassword=NULL<br \/>\ngo<\/p><\/blockquote>\n<p>For your environment you will need to make sure that linked server above points to the SSAS 2008 database that you would like to run this report on. When you want to do report on a different Analysis Services database, just change your linked server information to point to the different SSAS database and then re-run reports.<\/p>\n<p>In SQL Server 2008 I created Reporting Services solution.\u00a0In this solution I created one shared data source that was pointing to the same SQL server where\u00a0I previously created linked server.\u00a0I used tempdb database, but that does not mater, as all\u00a0queries for my reporting\u00a0are based on\u00a0the linked server. Then I created set of repors that were showing data from the SSAS MDVs:<\/p>\n<ul>\n<li>Cube List.rdl &#8211; list of cubes and perspectives in one Analysis Services 2008 database.<\/li>\n<li>Cube Measures.rdl &#8211; information about measure groups and measures in each cube\/perspective in one database.<\/li>\n<li>Dimension List.rdl &#8211; list of dimensions in one database.<\/li>\n<li>Dimension Details.rdl &#8211; information about dimension attributes and hierarchies in one database.<\/li>\n<li>KPIs.rdl &#8211; list of KPIs in the cubes<\/li>\n<li>Measure Group Dimensions.rdl &#8211; list of dimensions for each measure group.<\/li>\n<li>SSAS DB Structure.rdl &#8211; Main report that includes other reports as sub-reports.<\/li>\n<\/ul>\n<p><a href=\"http:\/\/www.ssas-info.com\/files_public\/post1365\/SSAS%20DB%20Structure%20Reports.zip\" target=\"_blank\">You can download SSRS solution with all reports here<\/a>.\u00a0\u00a0Latest solution with these reports will be always\u00a0 published here: <a href=\"http:\/\/www.ssas-info.com\/analysis-services-tools\/1365-ssrs-reports-to-document-ssas-2008-db-structure-using-dmvs\">http:\/\/www.ssas-info.com\/analysis-services-tools\/1365-ssrs-reports-to-document-ssas-2008-db-structure-using-dmvs<\/a><\/p>\n<p>When I was building queries on DMVs to return data, I delibarately choose to return all available fields. This makes it easier to customize existing report &#8211; in the report designer you will see all available fields that can be included in the report.<\/p>\n<p>When using linked server, textual data to SQL Server is returned with the type &#8220;text&#8221;. You cannot use that type of field in the joins or ordering &#8211; you have to convert it to varchar first. When converting to varchar, specify length of the fields, for example &#8220;CONVERT(varchar(500), YourFieldName)&#8221;. If you will use &#8220;CONVERT(varchar, YourFieldName), then\u00a0SQL Server will convert your text field to varchar(30) type and your joins in certain cases will be incorrect.<\/p>\n<p>Below I described each report and provided queries I used to get data from SSAS DMV.<\/p>\n<p><strong>Cube List.rdl<\/strong><\/p>\n<p>This report shows a list of cubes and perspectives in one Analysis Services 2008 database.<\/p>\n<p>Here is the query that was used for this report:<\/p>\n<blockquote><p>SELECT CONVERT(varchar, CASE WHEN BASE_CUBE_NAME IS NULL THEN CUBE_NAME ELSE BASE_CUBE_NAME END) AS BASE_CUBE_NAME_To_Order<br \/>\n\u00a0, CASE\u00a0WHEN BASE_CUBE_NAME IS NULL THEN CONVERT(varchar, CUBE_NAME)<br \/>\n\u00a0\u00a0\u00a0ELSE &#8216;\u00a0 &#8216; + CONVERT(varchar, CUBE_NAME)<br \/>\n\u00a0\u00a0 END AS CUBE_NAME_TO_PRINT<br \/>\n\u00a0, CASE WHEN BASE_CUBE_NAME IS NULL THEN &#8216;Cube&#8217; ELSE &#8216;Perspective&#8217; END AS CubeType<br \/>\n\u00a0 , *\u00a0\u00a0<br \/>\n\u00a0FROM OPENQUERY(SSAS_Reporter<br \/>\n\u00a0, &#8216;SELECT * FROM $system.MDSCHEMA_CUBES WHERE Cube_Source = 1&#8217;<br \/>\n\u00a0)<br \/>\nORDER BY 1<\/p><\/blockquote>\n<p><a href=\"http:\/\/www.ssas-info.com\/files_public\/post1365\/Cube%20List.pdf\" target=\"_blank\">Here is\u00a0the pdf file<\/a> generated by this report from the Adventure Works database.<\/p>\n<p><strong>Cube Measures.rdl<\/strong><\/p>\n<p>This report shows information about measure groups and measures in each cube\/perspective in one database.<\/p>\n<p>Here is the query that was used for this report:<\/p>\n<blockquote><p>SELECT<br \/>\n\u00a0\u00a0 C.[CATALOG_NAME], C.CUBE_NAME<br \/>\n\u00a0, C.IS_WRITE_ENABLED, C.BASE_CUBE_NAME<br \/>\n\u00a0, CASE WHEN BASE_CUBE_NAME IS NULL THEN &#8216;Cube&#8217; ELSE &#8216;Perspective&#8217; END AS CubeType<\/p>\n<p>\u00a0&#8212; Measure fields<br \/>\n\u00a0, CONVERT(varchar(500), M.MEASUREGROUP_NAME) AS MEASUREGROUP_NAME<br \/>\n\u00a0, CONVERT(varchar(500), M.[MEASURE_NAME]) AS MEASURE_NAME<br \/>\n\u00a0, CASE M.[MEASURE_AGGREGATOR]<br \/>\n\u00a0\u00a0WHEN 1 THEN &#8216;Sum&#8217;\u00a0WHEN 2 THEN &#8216;Count&#8217;\u00a0WHEN 3 THEN &#8216;Min&#8217;<br \/>\n\u00a0\u00a0WHEN 4 THEN &#8216;Max&#8217;\u00a0WHEN 8 THEN &#8216;Distinct Count&#8217; WHEN 9 THEN &#8216;None&#8217;\u00a0<br \/>\n\u00a0\u00a0WHEN 10 THEN &#8216;AverageOfChildren&#8217; WHEN 11 THEN &#8216;FirstChild&#8217;<br \/>\n\u00a0\u00a0WHEN 12 THEN &#8216;LastChild&#8217;\u00a0WHEN 13 THEN &#8216;FirstNonEmpty&#8217;<br \/>\n\u00a0\u00a0WHEN 14 THEN &#8216;LastNonEmpty&#8217;\u00a0WHEN 15 THEN &#8216;ByAccount&#8217;<br \/>\n\u00a0\u00a0WHEN 127 THEN &#8216;Calculated measure&#8217;<br \/>\n\u00a0\u00a0ELSE &#8216;N\/A&#8217;<br \/>\n\u00a0\u00a0 END AS AggregateFunction<br \/>\n\u00a0, D.[TYPE_NAME] AS DATA_TYPE_NAME<br \/>\n\u00a0, D.[COLUMN_SIZE]<br \/>\n\u00a0, M.[NUMERIC_PRECISION]<br \/>\n\u00a0, M.[NUMERIC_SCALE]<br \/>\n\u00a0, M.[EXPRESSION]<br \/>\n\u00a0, M.[MEASURE_IS_VISIBLE]<br \/>\n\u00a0, M.[DEFAULT_FORMAT_STRING]<br \/>\n\u00a0<br \/>\n\u00a0FROM OPENQUERY(SSAS_Reporter, &#8216;SELECT * FROM $SYSTEM.MDSCHEMA_MEASURES&#8217;<br \/>\n\u00a0\u00a0) M<br \/>\n\u00a0JOIN OPENQUERY(SSAS_Reporter,<br \/>\n\u00a0 &#8216; SELECT DATA_TYPE, TYPE_NAME, COLUMN_SIZE, IS_FIXEDLENGTH<br \/>\n\u00a0\u00a0 FROM $SYSTEM.DBSCHEMA_PROVIDER_TYPES &#8212; Data types here<br \/>\n\u00a0&#8216;<br \/>\n\u00a0) D ON D.DATA_TYPE = M.DATA_TYPE<br \/>\n\u00a0JOIN OPENQUERY(SSAS_Reporter,<br \/>\n&#8216;<br \/>\nSELECT [CATALOG_NAME], CUBE_NAME<br \/>\n\u00a0, IS_WRITE_ENABLED, BASE_CUBE_NAME<br \/>\n\u00a0 FROM $SYSTEM.MDSCHEMA_CUBES<br \/>\n\u00a0WHERE LEFT(CUBE_NAME,1) &lt;&gt; &#8221;$&#8221;<br \/>\n\u00a0 &#8216;) C ON CONVERT(varchar(500), C.CUBE_NAME) = CONVERT(varchar(500), M.CUBE_NAME)<br \/>\n\u00a0<br \/>\nWHERE M.[MEASURE_AGGREGATOR] &lt;&gt; 127<br \/>\nORDER BY CONVERT(varchar(500), C.CUBE_NAME)<br \/>\n\u00a0, CONVERT(varchar(500), M.MEASUREGROUP_NAME)<br \/>\n\u00a0, CONVERT(varchar(500), M.[MEASURE_NAME])<\/p><\/blockquote>\n<p><a href=\"http:\/\/www.ssas-info.com\/files_public\/post1365\/Cube%20Measures.pdf\" target=\"_blank\">Here is\u00a0the\u00a0pdf file<\/a> generated by this report from the Adventure Works database.<\/p>\n<p><strong>Dimension List.rdl<\/strong><\/p>\n<p>This report shows a list of dimensions in one database.<\/p>\n<p>Here is the query that was used for this report:<\/p>\n<blockquote><p>SELECT CONVERT(varchar, DIMENSION_NAME) AS Dimension<br \/>\n\u00a0, *\u00a0\u00a0<br \/>\n\u00a0, CASE DIMENSION_TYPE<br \/>\n\u00a0\u00a0WHEN 0 THEN &#8216;Unknown&#8217;\u00a0WHEN 1 THEN &#8216;Time&#8217;\u00a0\u00a0\u00a0WHEN 2 THEN &#8216;Measure&#8217;<br \/>\n\u00a0\u00a0WHEN 3 THEN &#8216;Other&#8217;\u00a0\u00a0WHEN 5 THEN &#8216;Quantitative&#8217;\u00a0WHEN 6 THEN &#8216;Accounts&#8217;<br \/>\n\u00a0\u00a0WHEN 7 THEN &#8216;Customers&#8217;\u00a0WHEN 8 THEN &#8216;Products&#8217;\u00a0\u00a0WHEN 9 THEN &#8216;Scenario&#8217;<br \/>\n\u00a0\u00a0WHEN 10 THEN &#8216;Utility&#8217;\u00a0WHEN 11 THEN &#8216;Currency&#8217;\u00a0\u00a0WHEN 12 THEN &#8216;Rates&#8217;<br \/>\n\u00a0\u00a0WHEN 13 THEN &#8216;Channle&#8217;\u00a0WHEN 14 THEN &#8216;Promotion&#8217;\u00a0WHEN 15 THEN &#8216;Organization&#8217;<br \/>\n\u00a0\u00a0WHEN 16 THEN &#8216;Bill of materials&#8217;\u00a0WHEN 17 THEN &#8216;Geography&#8217;<br \/>\n\u00a0\u00a0ELSE CONVERT(varchar, DIMENSION_TYPE)<br \/>\n\u00a0\u00a0 END AS DimensionType\u00a0<\/p>\n<p>\u00a0FROM OPENQUERY(SSAS_Reporter<br \/>\n\u00a0, &#8216;<br \/>\n\u00a0SELECT * FROM $SYSTEM.MDSCHEMA_DIMENSIONS<br \/>\n\u00a0 WHERE LEFT(CUBE_NAME,1) = &#8221;$&#8221;<br \/>\n\u00a0\u00a0\u00a0 AND DIMENSION_NAME &lt;&gt; &#8221;Measures&#8221;<br \/>\n\u00a0&#8216;<br \/>\n\u00a0)<br \/>\nORDER BY 1<\/p><\/blockquote>\n<p><a href=\"http:\/\/www.ssas-info.com\/files_public\/post1365\/Dimension%20List.pdf\" target=\"_blank\">Here is the pdf file<\/a> generated by this report from the Adventure Works database.<\/p>\n<p><strong>Dimension Details.rdl<\/strong><\/p>\n<p>This report shows information about dimension attributes and hierarchies in one database.<\/p>\n<p>Here is the query that was used for this report:<\/p>\n<blockquote><p>SELECT CONVERT(varchar, D.DIMENSION_NAME) AS DIMENSION_NAME<br \/>\n\u00a0, D.[CATALOG_NAME]<br \/>\n\u00a0, CASE D.DIMENSION_TYPE<br \/>\n\u00a0\u00a0WHEN 0 THEN &#8216;Unknown&#8217;\u00a0WHEN 1 THEN &#8216;Time&#8217;\u00a0\u00a0\u00a0WHEN 2 THEN &#8216;Measure&#8217;<br \/>\n\u00a0\u00a0WHEN 3 THEN &#8216;Other&#8217;\u00a0\u00a0WHEN 5 THEN &#8216;Quantitative&#8217;\u00a0WHEN 6 THEN &#8216;Accounts&#8217;<br \/>\n\u00a0\u00a0WHEN 7 THEN &#8216;Customers&#8217;\u00a0WHEN 8 THEN &#8216;Products&#8217;\u00a0\u00a0WHEN 9 THEN &#8216;Scenario&#8217;<br \/>\n\u00a0\u00a0WHEN 10 THEN &#8216;Utility&#8217;\u00a0WHEN 11 THEN &#8216;Currency&#8217;\u00a0\u00a0WHEN 12 THEN &#8216;Rates&#8217;<br \/>\n\u00a0\u00a0WHEN 13 THEN &#8216;Channel&#8217;\u00a0WHEN 14 THEN &#8216;Promotion&#8217;\u00a0WHEN 15 THEN &#8216;Organization&#8217;<br \/>\n\u00a0\u00a0WHEN 16 THEN &#8216;Bill of materials&#8217;\u00a0WHEN 17 THEN &#8216;Geography&#8217;<br \/>\n\u00a0\u00a0ELSE CONVERT(varchar, D.DIMENSION_TYPE)<br \/>\n\u00a0\u00a0 END AS DimensionType\u00a0<\/p>\n<p>\u00a0, D.DIMENSION_CARDINALITY\u00a0, D.DimensionDescription<br \/>\n\u00a0, D.IS_READWRITE AS DimensionIsReadWrite<\/p>\n<p>\u00a0&#8212; Hierarchy fields<br \/>\n\u00a0, H.HIERARCHY_NAME, H.HIERARCHY_CAPTION, H.DIMENSION_TYPE, H.HIERARCHY_CARDINALITY, H.DEFAULT_MEMBER<br \/>\n\u00a0, H.ALL_MEMBER, H.[DESCRIPTION] AS HierarchyDescription, H.Structure, H.IS_VIRTUAL<br \/>\n\u00a0, H.IS_READWRITE, H.DIMENSION_UNIQUE_SETTINGS, H.DIMENSION_MASTER_UNIQUE_NAME, H.DIMENSION_IS_VISIBLE<br \/>\n\u00a0, H.HIERARCHY_ORDINAL<br \/>\n\u00a0, H.DIMENSION_IS_SHARED &#8212; Always true<br \/>\n\u00a0, H.HIERARCHY_IS_VISIBLE<br \/>\n\u00a0, H.HIERARCHY_ORIGIN<br \/>\n\u00a0, H.HIERARCHY_DISPLAY_FOLDER<br \/>\n\u00a0, H.INSTANCE_SELECTION<br \/>\n\u00a0, H.GROUPING_BEHAVIOR<br \/>\n\u00a0, CONVERT(bit,CASE WHEN CONVERT(int, H.HIERARCHY_ORIGIN) &amp; 1 = 1 THEN 1 ELSE 0 END) AS UserDefined<br \/>\n\u00a0, CONVERT(bit,CASE WHEN CONVERT(int, H.HIERARCHY_ORIGIN) &amp; 2 = 2 THEN 1 ELSE 0 END) AS SystemEnabled<br \/>\n\u00a0, CONVERT(bit,CASE WHEN CONVERT(int, H.HIERARCHY_ORIGIN) &amp; 4 = 4 THEN 1 ELSE 0 END) AS SystemInternal<br \/>\n\u00a0, CONVERT(bit,CASE WHEN CONVERT(int, H.HIERARCHY_ORIGIN) &amp; 3 = 3 THEN 1 ELSE 0 END) AS ParentChild<\/p>\n<p>\u00a0&#8212; Level Fields<br \/>\n\u00a0, L.DIMENSION_UNIQUE_NAME, L.HIERARCHY_UNIQUE_NAME<br \/>\n\u00a0, L.LEVEL_NAME, L.LEVEL_UNIQUE_NAME, L.LEVEL_CAPTION, L.LEVEL_NUMBER, L.LEVEL_CARDINALITY<br \/>\n\u00a0, L.LEVEL_TYPE, L.[DESCRIPTION] AS LevelDescription, L.CUSTOM_ROLLUP_SETTINGS, L.LEVEL_UNIQUE_SETTINGS<br \/>\n\u00a0, L.LEVEL_IS_VISIBLE, L.LEVEL_ORDERING_PROPERTY, L.LEVEL_DBTYPE, L.LEVEL_MASTER_UNIQUE_NAME<br \/>\n\u00a0, L.LEVEL_NAME_SQL_COLUMN_NAME, L.LEVEL_KEY_SQL_COLUMN_NAME, L.LEVEL_UNIQUE_NAME_SQL_COLUMN_NAME<br \/>\n\u00a0, L.LEVEL_ATTRIBUTE_HIERARCHY_NAME, L.LEVEL_KEY_CARDINALITY, L.LEVEL_ORIGIN<br \/>\n\u00a0, CONVERT(bit, CASE WHEN CONVERT(int, L.LEVEL_ORIGIN) &amp; 1 = 1 THEN 1 ELSE 0 END) AS UserDefinedHierarchy<br \/>\n\u00a0, CONVERT(bit, CASE WHEN CONVERT(int, L.LEVEL_ORIGIN) &amp; 2 = 2 THEN 1 ELSE 0 END) AS AttributeHierarchy<br \/>\n\u00a0, CONVERT(bit, CASE WHEN CONVERT(int, L.LEVEL_ORIGIN) &amp; 4 = 4 THEN 1 ELSE 0 END) AS KeyAttributeHierarchy<br \/>\n\u00a0, CONVERT(bit, CASE WHEN CONVERT(int, L.LEVEL_ORIGIN) &amp; 4 = 8 THEN 1 ELSE 0 END) AS NotEnabledLevelsInHierarchy<br \/>\n\u00a0FROM OPENQUERY(SSAS_Reporter<br \/>\n\u00a0, &#8216;<br \/>\n\u00a0SELECT * FROM $SYSTEM.MDSCHEMA_LEVELS<br \/>\n\u00a0WHERE LEFT(CUBE_NAME,1) = &#8221;$&#8221;<br \/>\n\u00a0\u00a0 AND [DIMENSION_UNIQUE_NAME] &lt;&gt; &#8221;[Measures]&#8221;<br \/>\n\u00a0\u00a0\u00a0 &#8216;<br \/>\n\u00a0) L<br \/>\n\u00a0JOIN OPENQUERY(SSAS_Reporter<br \/>\n\u00a0, &#8216;<br \/>\nSELECT * FROM $SYSTEM.MDSCHEMA_HIERARCHIES<br \/>\n\u00a0WHERE LEFT(CUBE_NAME,1) = &#8221;$&#8221;<br \/>\n\u00a0\u00a0 AND [DIMENSION_UNIQUE_NAME] &lt;&gt; &#8221;[Measures]&#8221;<br \/>\n&#8216;) H<br \/>\n\u00a0ON CONVERT(varchar(500), H.[HIERARCHY_UNIQUE_NAME]) = CONVERT(varchar(500), L.[HIERARCHY_UNIQUE_NAME])<br \/>\n\u00a0<br \/>\n\u00a0JOIN OPENQUERY(SSAS_Reporter<br \/>\n\u00a0, &#8216;<br \/>\n\u00a0SELECT [CATALOG_NAME], CUBE_NAME, DIMENSION_NAME<br \/>\n\u00a0, DIMENSION_TYPE, DIMENSION_CARDINALITY<br \/>\n\u00a0, [DESCRIPTION] AS DimensionDescription<br \/>\n\u00a0, IS_READWRITE<br \/>\n\u00a0 FROM $SYSTEM.MDSCHEMA_DIMENSIONS<br \/>\n\u00a0 WHERE LEFT(CUBE_NAME, 1) = &#8221;$&#8221;<br \/>\n\u00a0\u00a0\u00a0 AND DIMENSION_NAME &lt;&gt; &#8221;Measures&#8221;<br \/>\n\u00a0\u00a0\u00a0 &#8216;) D ON CONVERT(varchar(500), D.CUBE_NAME) = CONVERT(varchar(500), H.CUBE_NAME)<br \/>\nWHERE CONVERT(varchar, L.LEVEL_NAME) &lt;&gt; &#8216;(All)&#8217; &#8212; Exclude ALL level, need to find a better way to do that<br \/>\nORDER BY H.HIERARCHY_ORDINAL, L.LEVEL_NUMBER<\/p><\/blockquote>\n<p><a href=\"http:\/\/www.ssas-info.com\/files_public\/post1365\/Dimension%20Details.pdf\" target=\"_blank\">Here is the pdf file<\/a> generated by this report from the Adventure Works database.<\/p>\n<p><strong>KPIs.rdl<\/strong><\/p>\n<p>This reports shows a list of KPIs in the cubes.<\/p>\n<p>Here is the query that was used for this report:<\/p>\n<blockquote><p>SELECT K.*<br \/>\n\u00a0FROM OPENQUERY(SSAS_Reporter<br \/>\n\u00a0, &#8216;SELECT *<br \/>\n\u00a0\u00a0\u00a0 FROM $SYSTEM.MDSCHEMA_KPIS<br \/>\n\u00a0&#8216;) K<br \/>\n\u00a0JOIN<br \/>\n\u00a0\u00a0 OPENQUERY(SSAS_Reporter<br \/>\n\u00a0, &#8216;SELECT *<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0 FROM $SYSTEM.MDSCHEMA_CUBES<br \/>\n\u00a0\u00a0\u00a0\u00a0 WHERE LEFT(CUBE_NAME,1) &lt;&gt; &#8221;$&#8221;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 AND LEN(BASE_CUBE_NAME) = 0<br \/>\n\u00a0&#8216;) C ON CONVERT(varchar(500), C.CUBE_NAME) = CONVERT(varchar(500), K.CUBE_NAME)<\/p><\/blockquote>\n<p><a href=\"http:\/\/www.ssas-info.com\/files_public\/post1365\/KPIs.pdf\" target=\"_blank\">Here is the pdf file<\/a> generated by this report from the Adventure Works database.<\/p>\n<p><strong>Measure Group Dimensions.rdl<\/strong><\/p>\n<p>This reports shows a list of dimensions for each measure group.<\/p>\n<p>Here is the query that was used for this report:<\/p>\n<blockquote><p>SELECT\u00a0 MD.*<br \/>\n\u00a0, D.DIMENSION_NAME<br \/>\n\u00a0FROM OPENQUERY(SSAS_Reporter<br \/>\n\u00a0, &#8216;<br \/>\nSELECT CUBE_NAME, MEASUREGROUP_NAME, MEASUREGROUP_CARDINALITY<br \/>\n\u00a0, [DIMENSION_UNIQUE_NAME], DIMENSION_CARDINALITY<br \/>\n\u00a0, DIMENSION_IS_VISIBLE<br \/>\n\u00a0, DIMENSION_IS_FACT_DIMENSION, DIMENSION_GRANULARITY<br \/>\n\u00a0 FROM $SYSTEM.MDSCHEMA_MEASUREGROUP_DIMENSIONS<br \/>\nWHERE LEFT(CUBE_NAME, 1) &lt;&gt; &#8221;$&#8221;<br \/>\n\u00a0&#8216;<br \/>\n\u00a0) MD<br \/>\n\u00a0JOIN OPENQUERY(SSAS_Reporter<br \/>\n\u00a0, &#8216;<br \/>\nSELECT CUBE_NAME<br \/>\n\u00a0 FROM $SYSTEM.MDSCHEMA_CUBES<br \/>\n\u00a0WHERE LEFT(CUBE_NAME,1) &lt;&gt; &#8221;$&#8221;<br \/>\n\u00a0\u00a0\u00a0 AND LEN(BASE_CUBE_NAME) = 0<br \/>\n&#8216;) C<br \/>\n\u00a0ON CONVERT(varchar(500), C.[CUBE_NAME]) = CONVERT(varchar(500), MD.[CUBE_NAME])<br \/>\n\u00a0<br \/>\n\u00a0JOIN OPENQUERY(SSAS_Reporter<br \/>\n, &#8216;<br \/>\nSELECT [DIMENSION_UNIQUE_NAME], DIMENSION_NAME<br \/>\n\u00a0 FROM $SYSTEM.MDSCHEMA_DIMENSIONS<br \/>\n\u00a0WHERE LEFT(CUBE_NAME, 1) = &#8221;$&#8221;<br \/>\n&#8216;) D<br \/>\n\u00a0ON CONVERT(varchar(500), D.[DIMENSION_UNIQUE_NAME]) = CONVERT(varchar(500), MD.[DIMENSION_UNIQUE_NAME])<br \/>\n\u00a0<br \/>\nORDER BY CONVERT(varchar(500), MD.CUBE_NAME)<br \/>\n\u00a0, CONVERT(varchar(500), MD.MEASUREGROUP_NAME)<br \/>\n\u00a0, CONVERT(varchar(500), D.[DIMENSION_NAME])<\/p><\/blockquote>\n<p><a href=\"http:\/\/www.ssas-info.com\/files_public\/post1365\/Measure%20Group%20Dimensions.pdf\" target=\"_blank\">Here is the pdf file<\/a> generated by this report from the Adventure Works database.<\/p>\n<p><strong>SSAS DB Structure.rdl<\/strong><\/p>\n<p>This is main report that includes other reports as sub-reports.<\/p>\n<p><a href=\"http:\/\/www.ssas-info.com\/files_public\/post1365\/SSAS%20DB%20Structure.pdf\" target=\"_blank\">Here is the pdf file<\/a> generated by this report from the Adventure Works database.<\/p>\n<p><strong>Note: My blog software substitutes single and double quotes with symbols that look similar, but are not recognized by SQL Server. If you will copy any\u00a0query from this post, you will have to replace quotes with proper symbols.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>New SSAS 2008 DMVs allows you to easily access Microsoft SQL Server Analysis Services (SSAS) metadata &#8211; information about cubes, dimensions, measure groups, measures, etc. As with DMVs metadata information is returned in the data set format, it is very easy to build Reporting Services reports to generate documentation about your database.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[10,9,11,21,8],"aioseo_notices":[],"_links":{"self":[{"href":"http:\/\/www.ssas-info.com\/VidasMatelisBlog\/wp-json\/wp\/v2\/posts\/144"}],"collection":[{"href":"http:\/\/www.ssas-info.com\/VidasMatelisBlog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ssas-info.com\/VidasMatelisBlog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ssas-info.com\/VidasMatelisBlog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ssas-info.com\/VidasMatelisBlog\/wp-json\/wp\/v2\/comments?post=144"}],"version-history":[{"count":9,"href":"http:\/\/www.ssas-info.com\/VidasMatelisBlog\/wp-json\/wp\/v2\/posts\/144\/revisions"}],"predecessor-version":[{"id":153,"href":"http:\/\/www.ssas-info.com\/VidasMatelisBlog\/wp-json\/wp\/v2\/posts\/144\/revisions\/153"}],"wp:attachment":[{"href":"http:\/\/www.ssas-info.com\/VidasMatelisBlog\/wp-json\/wp\/v2\/media?parent=144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ssas-info.com\/VidasMatelisBlog\/wp-json\/wp\/v2\/categories?post=144"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ssas-info.com\/VidasMatelisBlog\/wp-json\/wp\/v2\/tags?post=144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}