如何报告TFS 2008中某一周的已完成工作?

时间:2021-08-22 09:50:17

We're on Team Foundation Server 2008 and I'm trying to find a way to report on the change in completed work from week to week at the task level. The MDX query below works pretty well, but I'd like to get rid of need to hard code last week's date. I've tried using prevmember and parallelperiod without success, but I'm no MDX expert.

我们在Team Foundation Server 2008上,我正在尝试找到一种方法来报告任务级别每周完成工作的变化。下面的MDX查询效果很好,但我想摆脱上周日期硬编码的需要。我尝试过使用prevmember和parallelperiod但没有成功,但我不是MDX专家。

WITH 
MEMBER [Measures].[Completed Work by WI on dt1] AS
(
[Assigned To].[Person].CurrentMember,
[Work Item].[System_Id].CurrentMember,
[Date].[Year Week Date].[Week].&[2008-12-07T00:00:00],
[Measures].[Microsoft_VSTS_Scheduling_CompletedWork]
)

MEMBER [Measures].[Completed Work by WI on dt2] AS
(
[Assigned To].[Person].CurrentMember,
[Work Item].[System_Id].CurrentMember,
[Date].[Year Week Date].CurrentMember,
[Measures].[Microsoft_VSTS_Scheduling_CompletedWork]
)

MEMBER [Measures].[Completed Work] AS
[Measures].[Completed Work by WI on dt2] - [Measures].[Completed Work by WI on dt1]

SELECT
NON EMPTY
{
[Measures].[Completed Work] 
}
ON COLUMNS,

NON EMPTY
{
Filter(
([Assigned To].[Person].[Person],[Work Item].[System_Id].[System_Id],[Work Item].[System_Title].[System_Title]), [Measures].[Completed Work] >0 )
}
ON ROWS

FROM [Team System]

2 个解决方案

#1


Look at the provided Work Completed report. It automatically sets one of its date fields to today minus one month.

查看提供的Work Completed报告。它会自动将其日期字段之一设置为今天减去一个月。

EDIT: Just logged into my work system to double check on this. The report is actually called "Remaining Work". Go to the SharePoint portal that was created for your Team Project, and find the list of standard reports. It'll be in that list. You can export that report to file, open it in Visual Studio and see the date field logic.

编辑:刚登录我的工作系统,仔细检查这一点。该报告实际上被称为“剩余工作”。转到为团队项目创建的SharePoint门户,然后找到标准报告列表。它将在该列表中。您可以将该报告导出到文件,在Visual Studio中打开它并查看日期字段逻辑。

EDIT2: For an MDX function to get the previous week, try a variation on this: http://social.msdn.microsoft.com/Forums/en-US/tfsreporting/thread/0a656453-eaf1-47a2-a376-cb6eaec0db51

EDIT2:要获得前一周的MDX功能,请尝试使用此变体:http://social.msdn.microsoft.com/Forums/en-US/tfsreporting/thread/0a656453-eaf1-47a2-a376-cb6eaec0db51

#2


@sliderhouserules - I took a look at that report and it appears it is just taking the date entered and using the strtomember function. In my query, it looks like it would be the equivalent of the line with the hard coded date with:

@sliderhouserules - 我看了看那个报告,看来只是输入了日期并使用了strtomember函数。在我的查询中,看起来它将等同于具有硬编码日期的行:

StrToMember("[Date].[Year Week Date].[Week].&[" + Format(DATEADD("d", -7, "2008-12-21"), "s") + "]")

This works fine. However, what I really want is to eliminate the need to hard code anything. I tried using the Now() function instead of the hard coded date. I wasn't able to get it to work, but even if I did it would still mean that I'd need to change the number of days to subtract to get back to the Sunday of the previous week. It seems like there should be an MDX function that would make this work. If not, then perhaps there is some way to modify the StrToMember line to derive the previous Sunday's date in the proper format.

这很好用。但是,我真正想要的是消除硬编码任何东西的需要。我尝试使用Now()函数而不是硬编码日期。我无法让它工作,但即使我这样做仍然意味着我需要改变减去的天数才能回到前一周的星期日。似乎应该有一个MDX函数可以使这个工作。如果没有,那么也许有一些方法可以修改StrToMember行,以正确的格式导出上一个星期日的日期。

#1


Look at the provided Work Completed report. It automatically sets one of its date fields to today minus one month.

查看提供的Work Completed报告。它会自动将其日期字段之一设置为今天减去一个月。

EDIT: Just logged into my work system to double check on this. The report is actually called "Remaining Work". Go to the SharePoint portal that was created for your Team Project, and find the list of standard reports. It'll be in that list. You can export that report to file, open it in Visual Studio and see the date field logic.

编辑:刚登录我的工作系统,仔细检查这一点。该报告实际上被称为“剩余工作”。转到为团队项目创建的SharePoint门户,然后找到标准报告列表。它将在该列表中。您可以将该报告导出到文件,在Visual Studio中打开它并查看日期字段逻辑。

EDIT2: For an MDX function to get the previous week, try a variation on this: http://social.msdn.microsoft.com/Forums/en-US/tfsreporting/thread/0a656453-eaf1-47a2-a376-cb6eaec0db51

EDIT2:要获得前一周的MDX功能,请尝试使用此变体:http://social.msdn.microsoft.com/Forums/en-US/tfsreporting/thread/0a656453-eaf1-47a2-a376-cb6eaec0db51

#2


@sliderhouserules - I took a look at that report and it appears it is just taking the date entered and using the strtomember function. In my query, it looks like it would be the equivalent of the line with the hard coded date with:

@sliderhouserules - 我看了看那个报告,看来只是输入了日期并使用了strtomember函数。在我的查询中,看起来它将等同于具有硬编码日期的行:

StrToMember("[Date].[Year Week Date].[Week].&[" + Format(DATEADD("d", -7, "2008-12-21"), "s") + "]")

This works fine. However, what I really want is to eliminate the need to hard code anything. I tried using the Now() function instead of the hard coded date. I wasn't able to get it to work, but even if I did it would still mean that I'd need to change the number of days to subtract to get back to the Sunday of the previous week. It seems like there should be an MDX function that would make this work. If not, then perhaps there is some way to modify the StrToMember line to derive the previous Sunday's date in the proper format.

这很好用。但是,我真正想要的是消除硬编码任何东西的需要。我尝试使用Now()函数而不是硬编码日期。我无法让它工作,但即使我这样做仍然意味着我需要改变减去的天数才能回到前一周的星期日。似乎应该有一个MDX函数可以使这个工作。如果没有,那么也许有一些方法可以修改StrToMember行,以正确的格式导出上一个星期日的日期。