简体   繁体   English

在一个SSRS图表报告中加入两个数据集

[英]Join Two Dataset In One SSRS Chart Report

i Have two data sets. 我有两个数据集。 First one dataset shows Total counts against each person and the Second one Dataset shows SLA breached counts against respective person. 第一个数据集显示针对每个人的总计数,第二个数据集显示针对相应人员的SLA违反计数。 As before i used two charts for for the above datasets and result will be achieved but now i want these two datasets result in just one chart. 和以前一样,我使用两个图表来获得上述数据集,结果将会实现,但现在我希望这两个数据集只产生一个图表。 kindly tell me how to do this to achieve desired result. 请告诉我如何做到这一点,以达到预期的效果。 Dataset 1 (Total Counts query is): 数据集1(总计数查询):

Select Count(I.Id) AS TotalId,
U.Firstname AS Username
From I
Group U.Firstname

Dataset 2 (SLA Breached query is): 数据集2(SLA违反查询):

Select Count(I.Id) AS BreachedId,
U.Firstname AS Username
From I
***Where I.ResolvedDate > I. ResolvedByDate***
Group U.Firstname

The highlighted query is just used in dataset 2 which shows SLA Breached counts. 突出显示的查询仅用于显示SLA违规计数的数据集2。 Rest of the query in both dataset are same. 两个数据集中的其余查询都是相同的。 so now i don`t know how show toghether. 所以现在我不知道如何表现出来。 I used union all function but it add both TotalId and BreachedId. 我使用了union all函数,但它添加了TotalId和BreachedId。

Thanks 谢谢

AhsanMisbah AhsanMisbah

Do you want both aggregates to appear in the same query? 您是否希望两个聚合都出现在同一个查询中? if so change your select to 如果是这样,将你的选择改为

select  U.Firstname AS Username, Count(I.Id) AS TotalId, nullif(SUM(case when I.ResolvedDate > I. ResolvedByDate then 1 else 0 end ),0) as Breached

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM