MDX 中用于动态管理视图的 WHERE 子句
WHERE clause in MDX for Dynamic Management Views
我正在尝试使用 DMV 从表格立方体查询元数据。我能够在没有 where 子句的情况下让它工作,但我似乎无法让 where 子句工作。有什么建议吗?
这是有效的代码:
SELECT
[MEASURE_CAPTION] AS [Measure]
,[MEASURE_IS_VISIBLE] AS [Visable]
,[DESCRIPTION] AS [Description]
,[MEASURE_DISPLAY_FOLDER] AS [Display Folder]
,[EXPRESSION] AS [Calculation]
FROM $SYSTEM.MDSCHEMA_MEASURES
我试过的WHERE子句是:
WHERE ([MEASURE_IS_VISIBLE].[members].[true])
我收到以下错误:
The dot expression is not allowed in the context at line 9, column 1.
还有:
WHERE [MEASURE_IS_VISIBLE] = TRUE
我收到以下错误:
Error: A Boolean expression is not allowed in the context at line 9, column 7.
我在这些主题上尝试了很多版本,但总是得到相同的结果。我一点也不熟悉 MDX 的工作原理,所以任何帮助将不胜感激。
MEASURE_IS_VISIBLE
是一个布尔值列,必须这样过滤。以下查询将结果筛选为仅 MEASURE_IS_VISIBLE
值为 true 的结果。对于错误的行,将其更改为 WHERE NOT MEASURE_IS_VISIBLE
。您可以从文档 here.
中查看此 DMV 的数据类型
SELECT
[MEASURE_CAPTION] AS [Measure]
,[MEASURE_IS_VISIBLE] AS [Visable]
,[DESCRIPTION] AS [Description]
,[MEASURE_DISPLAY_FOLDER] AS [Display Folder]
,[EXPRESSION] AS [Calculation]
FROM $SYSTEM.MDSCHEMA_MEASURES
WHERE MEASURE_IS_VISIBLE
我正在尝试使用 DMV 从表格立方体查询元数据。我能够在没有 where 子句的情况下让它工作,但我似乎无法让 where 子句工作。有什么建议吗?
这是有效的代码:
SELECT
[MEASURE_CAPTION] AS [Measure]
,[MEASURE_IS_VISIBLE] AS [Visable]
,[DESCRIPTION] AS [Description]
,[MEASURE_DISPLAY_FOLDER] AS [Display Folder]
,[EXPRESSION] AS [Calculation]
FROM $SYSTEM.MDSCHEMA_MEASURES
我试过的WHERE子句是:
WHERE ([MEASURE_IS_VISIBLE].[members].[true])
我收到以下错误:
The dot expression is not allowed in the context at line 9, column 1.
还有:
WHERE [MEASURE_IS_VISIBLE] = TRUE
我收到以下错误:
Error: A Boolean expression is not allowed in the context at line 9, column 7.
我在这些主题上尝试了很多版本,但总是得到相同的结果。我一点也不熟悉 MDX 的工作原理,所以任何帮助将不胜感激。
MEASURE_IS_VISIBLE
是一个布尔值列,必须这样过滤。以下查询将结果筛选为仅 MEASURE_IS_VISIBLE
值为 true 的结果。对于错误的行,将其更改为 WHERE NOT MEASURE_IS_VISIBLE
。您可以从文档 here.
SELECT
[MEASURE_CAPTION] AS [Measure]
,[MEASURE_IS_VISIBLE] AS [Visable]
,[DESCRIPTION] AS [Description]
,[MEASURE_DISPLAY_FOLDER] AS [Display Folder]
,[EXPRESSION] AS [Calculation]
FROM $SYSTEM.MDSCHEMA_MEASURES
WHERE MEASURE_IS_VISIBLE