用sql server manager studio 查询mdx 时, mdx 中的 参数应该如何 传值呢
如题 ,bi 新手,望 高手赐教
------最佳解决方案--------------------1、在SSMS里面执行MDX是没办法定义变量的;
2、如果你希望这个MDX生成一格报表,可以考虑使用SSRS,SSRS里可以为MDX传递参数;
3、SSIS里面也可以为MDX传递参数;
------其他解决方案--------------------给个你语句的例子
------其他解决方案--------------------SELECT
{
[Measures].[DateValue],
[Measures].[Work Item Count],
[Measures].[Microsoft_VSTS_Scheduling_RemainingWork],
[Measures].[Microsoft_VSTS_Scheduling_CompletedWork]
} ON COLUMNS,
{
CrossJoin(
Filter(
[Date].[Date].[Date],
[Date].[Date].CurrentMember.Member_Value >= CDate(@StartDateParam) AND
[Date].[Date].CurrentMember.Member_Value <= CDate(@EndDateParam)
),
[Work Item].[System_State].[All].Children
)
} ON ROWS
FROM
(
SELECT
CrossJoin(
StrToMember("[Team Project].[Project Node GUID].&[{" + @ProjectGuid + "}]"),
StrToSet(@StateParam),
StrToSet(@AreaParam),
StrToSet(@IterationParam),
Except(
Descendants(StrToSet(@WorkItemTypeParam)),
[Work Item].[System_WorkItemType].[All AllWorkItems] + StrToSet(@WorkItemsToExclude)
)
) ON COLUMNS
FROM [Team System]
)
------其他解决方案--------------------顺便再帮我看看这写的有没有问题
------其他解决方案--------------------发错了,应该是下面的
SELECT NON EMPTY { [Measures].[Microsoft_VSTS_Scheduling_Work] } ON COLUMNS,
NON EMPTY { ([Work Item].[Iteration Path].[Iteration Path].ALLMEMBERS * [Work Item].[System_Id].[System_Id].ALLMEMBERS * [Work Item].[System_Title].[System_Title].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
FROM
(
SELECT
(
{ [Work Item].[Microsoft_VSTS_Common_ErrorWit].&[否] }
)ON COLUMNS
FROM [Team System]
)
WHERE
(
StrToMember("[Team Project].[Project Node Name].&[" + @TeamProjectProjectNodeName + "]"),
StrToMember("[Work Item].[Area Path].&[" + @WorkItemAreaPath + "]"),
[Work Item].[Microsoft_VSTS_Common_ErrorWit].&[否]
)
CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS