1

I tried the MDX Query in SQL correctly But I will insert that query in the VisualStudio(SSAS) in the Calculated Members section, but the process time will be faulty

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])

I get the following error:

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

Amirhossein
  • 1,148
  • 3
  • 15
  • 34
Atarodi
  • 21
  • 4
  • Can you describe what you are trying to accomplish? What is supposed to be contained in the RegSt set? Is that basically the set in the where clause? – GregGalloway May 31 '20 at 20:44
  • i want a count of records from one special fact except one special member whit X value – Atarodi Jun 01 '20 at 12:25

2 Answers2

1

Based on your query, this is what you should be putting in Calculated measure

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

Plus make sure you uses Calculated measure not Set

GregGalloway
  • 11,355
  • 3
  • 16
  • 47
MoazRub
  • 2,881
  • 2
  • 10
  • 20
  • Thanks, but what is the point that end of this query is used, is this correct? – Atarodi Jun 02 '20 at 05:19
  • Sorry i did not understand, can you repeat – MoazRub Jun 02 '20 at 06:27
  • is your mean : with member Measures.RegST as ( Sum({[Dim Student Status].[Student Status Key].[Student Status Key]-[Dim Student Status].[Student Status Key].&[0]},[Measures].[Fact Student Status Count])) select Measures.RegST on columns from [DSV_REG_Amozesh DW]???? type this query in Calculated Member – Atarodi Jun 02 '20 at 08:03
1

its worked:

CREATE MEMBER CURRENTCUBE.[Measures].RegST AS [Measures].[Fact Student Status Count]-([Measures].[Fact Student Status Count],[Dim Student Status].[Student Status Key].&[0])

Atarodi
  • 21
  • 4