我正在尝试制作一个MDX查询,以便以后使用SSRS.从有效的基本查询开始:
Select NON EMPTY {
[Measures].[Score %]
,[Measures].[Month Key]
} on Columns,
NON EMPTY {
([Date].[YMD].[Month Name].&[201301])
* FILTER([Customer].[Customer Full Name].[Customer Full Name].members,
([Measures].[Score %], [Date].[YMD].&[201301]) <> null
AND ([Measures].[Score %], [Date].[YMD].&[201301]) <> 0 )
} on Rows
from [Cube]
Run Code Online (Sandbox Code Playgroud)
但这只持续了一个月.在SSRS中,我希望能够选择多个月,所以我将查询更改为:
Select NON EMPTY {
[Measures].[Score %]
,[Measures].[Month Key]
} on Columns,
NON EMPTY {
([Date].[YMD].[Month Name].&[201301] : [Date].[YMD].[Month Name].&[201307])
* FILTER([Customer].[Customer Full Name].[Customer Full Name].members,
([Measures].[Score %], ([Date].[YMD].&[201301] : [Date].[YMD].&[201307]))<> null
AND ([Measures].[Score %], ([Date].[YMD].&[201301] : [Date].[YMD].&[201307])) <> 0 …Run Code Online (Sandbox Code Playgroud)