在 MDX 查询中获取叶节点

发布于 2024-08-23 18:51:50 字数 1054 浏览 3 评论 0原文

我正在尝试在 TFS 多维数据集上创建 MDX 查询,以获取“估计”字段的历史值。对于每项任务,我希望获得设置“估算”字段的每个人的最后估算。例如,如果项目经理 Bob 将估算设置为 24 小时,然后开发人员 Dave 将其设置为 32 小时,我想创建一个查询,显示他们每个估算与实际工作时间 [工作已完成] 的差异。

我遇到的问题是,TFS 中工作项的历史值是通过转速(修订)来跟踪的,但 TFS 在单个转速中为已更改的工作项添加正值和负值。这使得总和看起来像 0 / 空单元格。

例如,Bob 在第 2 版中将估计值设置为 24。然后,Dave 在第 3 版中将其设置为 32。TFS 在第 2 版的 -24 数据仓库中添加了另一行。当这些数据汇总时,我看不到 Bob 的估计值。

如何仅选择正值?我尝试使用过滤器函数,这会返回正确的成员,但单元格的值仍然为 null

with
member [Last Estimate] as [Measures].[Microsoft_VSTS_CMMI_Estimate]
SELECT  
    {nonempty([Changed By].[Person].[All].Children*[Last Estimate])} ON 0,
    {nonempty([Work Item].[System_Id].[System_Id]*Filter([Work Item].[System_Rev].[All].Children, [Measures].[Microsoft_VSTS_CMMI_Estimate] > 0))} ON 1

FROM [Work Item History]
WHERE [Team Project].[Team Project].&[29];

这是结果

Work     rev     Bob             Dave
Item         Last Estimate  Last Estimate
7446      2  (null)          (null)
7446      3  (null)          32.0

每行都应该有两个人之一的值。

提前致谢!

I'm trying to create an MDX query on the TFS cube which gets the historical values of the Estimate field. For each task I want to get the last estimate for each person who set the Estimate field. For example if Bob the project manager sets the estimate to 24 hours and then Dave the developer sets it to 32 hours, I want to create a query which shows the variance of each of their estimates to the real hours worked [Work Completed].

The problem I'm running into is that the historical values of Work Items in TFS are tracked with revs (revisions), but TFS puts both a positive and negative value in a single rev for work items which are changed. Which makes the sum look like 0 / empty cell.

For example Bob sets the estimate to 24 in rev 2. Then Dave sets it to 32 in rev 3. TFS adds another row to the data warehouse of -24 for rev 2. When this gets rolled up I can't see bob's estimate.

How Do I select only the positive values? I tried using the filter function and this returns the right members, but the value of the cell is still null

with
member [Last Estimate] as [Measures].[Microsoft_VSTS_CMMI_Estimate]
SELECT  
    {nonempty([Changed By].[Person].[All].Children*[Last Estimate])} ON 0,
    {nonempty([Work Item].[System_Id].[System_Id]*Filter([Work Item].[System_Rev].[All].Children, [Measures].[Microsoft_VSTS_CMMI_Estimate] > 0))} ON 1

FROM [Work Item History]
WHERE [Team Project].[Team Project].&[29];

Here is the results

Work     rev     Bob             Dave
Item         Last Estimate  Last Estimate
7446      2  (null)          (null)
7446      3  (null)          32.0

Every row should have a value for one of the two people.

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

油饼 2024-08-30 18:51:50

过滤器函数过滤维度的成员,但这还不够,因为成员可以包含例如 24 和 -24。尝试使用 Iif 函数过滤度量本身:

with 
member [Last Estimate] as 
'
Iif([Measures].[Microsoft_VSTS_CMMI_Estimate] > 0, [Measures].[Microsoft_VSTS_CMMI_Estimate], 0)
'
SELECT   
    {nonempty([Changed By].[Person].[All].Children*[Last Estimate])} ON 0, 
    {nonempty([Work Item].[System_Id].[System_Id]*Filter([Work Item].[System_Rev].[All].Children, [Measures].[Microsoft_VSTS_CMMI_Estimate] > 0))} ON 1 

FROM [Work Item History] 
WHERE [Team Project].[Team Project].&[29]; 

The filter function filters the members of the dimension but this is not enough because a member can contain for example both 24 and -24. Try filtering the measure itself with the Iif function:

with 
member [Last Estimate] as 
'
Iif([Measures].[Microsoft_VSTS_CMMI_Estimate] > 0, [Measures].[Microsoft_VSTS_CMMI_Estimate], 0)
'
SELECT   
    {nonempty([Changed By].[Person].[All].Children*[Last Estimate])} ON 0, 
    {nonempty([Work Item].[System_Id].[System_Id]*Filter([Work Item].[System_Rev].[All].Children, [Measures].[Microsoft_VSTS_CMMI_Estimate] > 0))} ON 1 

FROM [Work Item History] 
WHERE [Team Project].[Team Project].&[29]; 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文