以下是我的MDX,它在SQL Server環境中完美執行。現在,我想創建一個使用SSRS的動態報告,通過從參數中選擇不同年份的結果。我創建了一個名爲'FY'的參數,我想通過這個參數傳遞每年的值,這就是爲什麼我將這個MDX作爲表達式傳遞並得到如下錯誤:「Query(1,385)Parser:'MEMBER'的語法不正確」。我不知道我在做什麼錯在哪裏?在此先感謝使用MDX如何使用參數創建動態報告
"WITH "+
"MEMBER [Total] AS "+
"SUM({[Measures].[July],[Measures].[August],[Measures].[September], "+
"[Measures].[October], [Measures].[November], "+
"[Measures].[December],[Measures].[January],[Measures].[February], "+
"[Measures].[March],[Measures].[April], "+
"[Measures].[May],[Measures].[June]}, [Dim Account].[Account Type].currentmember), "+
"MEMBER [Percent] AS "+
"Total/SUM({[Measures].[July],[Measures].[August],[Measures].[September], "+
"[Measures].[October], [Measures].[November], "+
"[Measures].[December],[Measures].[January],[Measures].[February], "+
"[Measures].[March],[Measures].[April], "+
"[Measures].[May],[Measures].[June]}, [Dim Account].[Account Type].[Income]), "+
"MEMBER [Dim Account].[Account Type].[Gross Profit] AS "+
" [Dim Account].[Account Type].[Income] - "+
"[Dim Account].[Account Type].[Cost of Sales], "+
"MEMBER [Dim Account].[Account Type].[Operating Profit] AS "+
" [Dim Account].[Account Type].[Gross Profit] - "+
"[Dim Account].[Account Type].[Expenses], "+
"MEMBER [Dim Account].[Account Type].[Net Profit] AS "+
" [Dim Account].[Account Type].[Operating Profit] + "+
"[Dim Account].[Account Type].[Other Income] - "+
"[Dim Account].[Account Type].[Other Expense], "+
"MEMBER [Dim Account].[Account Type].[EBITDA] AS "+
" [Dim Account].[Account Type].[Net Profit] + "+
"[Dim Account].[HierarchyAccount].[Account Activity]. "+
"&[Profit and Loss]&[Expenses]&[Interest] + "+
"[Dim Account].[HierarchyAccount].[Account Activity]. "+
"&[Profit and Loss]&[Cost of Sales]&[Depreciation]+ "+
"[Dim Account].[HierarchyAccount].[Account Activity]. "+
"&[Profit and Loss]&[Expenses]&[Depreciation]+ "+
"[Dim Account].[HierarchyAccount].[Account Activity]. "+
"&[Profit and Loss]&[Expenses]&[Amortisation], "+
"SELECT {[Measures].[July],[Measures].[August],[Measures].[September], "+
"[Measures].[October], [Measures].[November], "+
"[Measures].[December],[Measures].[January],[Measures].[February], "+
"[Measures].[March],[Measures].[April], "+
"[Measures].[May],[Measures].[June], Total, [Percent]} ON COLUMNS, "+
" { "+
" [Dim Account].[Account Type].&[Profit and Loss]&[Income], "+
" [Dim Account].[Account Type].&[Profit and Loss]&[Cost of Sales], "+
"[Dim Account].[Account Type].[Gross Profit], "+
" [Dim Account].[Account Type].&[Profit and Loss]&[Expenses], "+
"[Dim Account].[Account Type].[Operating Profit], "+
" [Dim Account].[Account Type].&[Profit and Loss]&[Other Income], "+
" [Dim Account].[Account Type].&[Profit and Loss]&[Other Expense], "+
"[Dim Account].[Account Type].[Net Profit], "+
"[Dim Account].[Account Type].[EBITDA]} ON ROWS "+
"FROM [DSV_IncomeStmt] "+
"where [Dim Yearto Date].[Fiscal Year].&["+Parameters!FY.Value+"] "
你應該具有其中應以表矩陣消耗的數據集的MDX。 FY持有的參數是什麼?請舉個例子。 – SouravA