0

我正在写一份报告来显示每个部门使用的气体使用量(以加仑为单位)。请求是查看每个月和每个部门使用的加仑数。需要一个列来显示每个部门的目标目标是什么,根据他们在过去的时间范围内使用的汽油加仑数。每个部门的目标目标比所述时间范围内使用的总加仑数少 x%。

我目前在 Reporting Services 中有一个矩阵,其中部门组成行,月组成列,加仑填充细节。矩阵由 dataset1 填充。我有每个部门每个月要求的数据分组。我的问题是计算目标。我的想法是创建第二个数据集(dataset2),它根据请求的时间范围返回使用的加仑数。我按部门对这些数据进行了分组。我希望我可以使用每个数据集中的部门字段来确保使用了适当的数字。

我添加了一个新列,显示在加仑字段旁边。当我尝试构建表达式时,我发现如果我对加仑字段求和,我只能从 dataset2 中获取使用的加仑。这给了我每个部门加起来使用的总加仑数。

我试图找到与我想要完成的类似示例的资源,但我似乎无法找到一个。我试图尽可能详细地保持这一点,而不会使其过于罗嗦。如果需要,我将非常乐意澄清或进一步详细解释我在上面所写的内容。如果有人有链接、评论或建议,他们将不胜感激。

下面是一个非常简单的视觉效果或我希望完成的工作。月份和部门将根据返回的数据进行扩展。

                  months
       ------------------------------

部门| 加仑/月 | 目标目标

4

1 回答 1

1

Add a subtotal to you 'Months' Column, and then use some trickery to get either the gallons/month or target goal for the data. You can do this by using the InScope() function - this defines whether or not a particular 'Detail' cell falls in the gallons/month column or the target goal (subtotal column). Define either the field (Fields!GallonsPerMonth.value) or the calculation (Fields!GallonsPerMonth.Value * x%) for the appropriate scope.

For more on the InScope() function try this link Let me know if you need any help with the expression for the Detail Cell.

PS - You've done a great job of explaining what you need.

于 2009-08-15T20:10:39.153 回答