我有这样的要求:我们有SharePoint列表,其中包含打开和关闭的请求。我想在堆叠条形图中显示这些请求,在给定时间段内打开与关闭。我通过创建一个数据集来实现这一点,该数据集使用创建日期列过滤给定日期的请求列表。
但是我的客户要求,应根据创建日期显示打开请求计数,然后根据修改日期显示已关闭的请求计数。例如,我今天打开一张票并明天关闭该票,因此该票应在明天的日期显示。如果任何机构在SSRS中堆叠时已经对不同的列进行了分组,请帮助我。
感谢您的帮助。
答案 0 :(得分:0)
让SQL为你做繁重的工作:
SELECT ReportDate, SUM(Opened) AS Opened, SUM(Closed) AS Closed
FROM (
SELECT Created AS ReportDate, 1 AS Opened, 0 AS Closed
FROM RequestTable
UNION ALL
SELECT Modified AS ReportDate, 0 AS Opened, 1 AS Closed
FROM RequestTable
WHERE Modified IS NOT NULL
)
GROUP BY ReportDate
假设在请求关闭且日期没有时间组件时设置了修改日期。