SSAS 计算成员中的 MDX 查询

MDX query in SSAS calculated member

我在 SQL 中正确地尝试了 MDX 查询 但我会将该查询插入计算成员部分的 VisualStudio(SSAS),但处理时间会出错

Select 
[Measures].[Fact Student Status Count]on columns
From [Cube_REG_Amozesh DW]
Where ( [Dim Student Status].[Student Status Key].[Student Status Key]-[Dim Student Status].[Student Status Key].&[0])

我收到以下错误:

Severity Code Description Project File Line Suppression State Error MdxScript(Cube_REG_Amozesh DW) (2, 5) Parser: The syntax for 'Select' is incorrect. (CREATE DYNAMIC SET CURRENTCUBE.[RegSt] AS Select [Measures].[Fact Student Status Count]on columns from [Cube_REG_Amozesh DW] where ( [Dim Student Status].[Student Status Key].[Student Status Key]-[Dim Student Status].[Student Status Key].&[0]), DISPLAY_FOLDER = 'شاخص' ; ). 0

根据您的查询,这就是您应该放入计算量度的内容

Sum({[Dim Student Status].[Student Status Key].[Student Status Key]-[Dim Student Status].[Student Status Key].&[0]},[Measures].[Fact Student Status Count]). 

另外请确保您使用的是计算的度量而不是设置

有效:

创建成员 CURRENTCUBE。[措施].RegST AS [Measures].[Fact Student Status Count]-([Measures].[Fact Student Status Count],[Dim Student Status].[Student Status Key].&[0])