SSRS 使用现有数据集计算人口和责任
SSRS Using existing datasets to work out population and accountability
我在一份报告中有 2 个数据集,第 1 个包含总人口,第 2 个包含评论。我需要在一个字段中做的是显示完成的百分比。例如dataset1.[Reviews] where Status = "incomplete" 和 Status = "high risk" / dataset2.[Population] where type = "high risk"
人口数据示例:
- 姓名、风险等级
- Client123,高风险
- Client124,中等风险
- Client125,高风险
- Client126,高风险
- Client127,高风险
- Client128,高风险
查看数据示例
- 客户名称,审核状态
- Client123,不完整
- Client124,完成
- Client125,完成
- Client126,不完整
- Client127,不完整
- Client128,不完整
所以 5 个高风险人群,4 个评论不完整 = 80% 拖欠
我需要尝试用一种表达方式来做到这一点,为了我的一生,我正在努力!也许是星期五的大脑!?
感谢任何帮助。
检查下面的 屏幕截图和步骤 以获得所需的输出
Sample Output
Expression Details
Row Group Details - 1
Row Group Details - 2
数据集 1
select 'Client123' as [NAME],'HIGH RISK' as [RISK LEVEL]
union all
select 'Client124' as [NAME],'MEDIUM RISK' as [RISK LEVEL]
union all
select 'Client125' as [NAME],'HIGH RISK' as [RISK LEVEL]
union all
select 'Client126' as [NAME],'HIGH RISK' as [RISK LEVEL]
union all
select 'Client127' as [NAME],'HIGH RISK' as [RISK LEVEL]
union all
select 'Client128' as [NAME],'HIGH RISK' as [RISK LEVEL]
数据集2
select 'Client123' as [CLIENT NAME] , 'INCOMPLETE' as [REVIEW STATUS]
union all
select 'Client124' as [CLIENT NAME] , 'COMPLETE' as [REVIEW STATUS]
union all
select 'Client125' as [CLIENT NAME] , 'COMPLETE' as [REVIEW STATUS]
union all
select 'Client126' as [CLIENT NAME] , 'INCOMPLETE' as [REVIEW STATUS]
union all
select 'Client127' as [CLIENT NAME] , 'INCOMPLETE' as [REVIEW STATUS]
union all
select 'Client128' as [CLIENT NAME] , 'INCOMPLETE' as [REVIEW STATUS]
本报告中使用的表达方式
1. Lookup(Fields!NAME.Value, Fields!CLIENT_NAME.Value, Fields!REVIEW_STATUS.Value, "DataSet2")
2. count(Lookup(Fields!NAME.Value, Fields!CLIENT_NAME.Value, Fields!REVIEW_STATUS.Value, "DataSet2"))
3. count(Lookup(Fields!NAME.Value, Fields!CLIENT_NAME.Value, Fields!REVIEW_STATUS.Value, "DataSet2"))/Count(Fields!NAME.Value,"RISK_LEVEL")
4. Count(Fields!NAME.Value, "RISK_LEVEL2")
我创建了两个示例报告。我提到了 sample report1
的组属性。对于 sample report2
组 属性 和第一个一样。
我在一份报告中有 2 个数据集,第 1 个包含总人口,第 2 个包含评论。我需要在一个字段中做的是显示完成的百分比。例如dataset1.[Reviews] where Status = "incomplete" 和 Status = "high risk" / dataset2.[Population] where type = "high risk"
人口数据示例:
- 姓名、风险等级
- Client123,高风险
- Client124,中等风险
- Client125,高风险
- Client126,高风险
- Client127,高风险
- Client128,高风险
查看数据示例
- 客户名称,审核状态
- Client123,不完整
- Client124,完成
- Client125,完成
- Client126,不完整
- Client127,不完整
- Client128,不完整
所以 5 个高风险人群,4 个评论不完整 = 80% 拖欠
我需要尝试用一种表达方式来做到这一点,为了我的一生,我正在努力!也许是星期五的大脑!?
感谢任何帮助。
检查下面的 屏幕截图和步骤 以获得所需的输出
Sample Output
Expression Details
Row Group Details - 1
Row Group Details - 2
数据集 1
select 'Client123' as [NAME],'HIGH RISK' as [RISK LEVEL]
union all
select 'Client124' as [NAME],'MEDIUM RISK' as [RISK LEVEL]
union all
select 'Client125' as [NAME],'HIGH RISK' as [RISK LEVEL]
union all
select 'Client126' as [NAME],'HIGH RISK' as [RISK LEVEL]
union all
select 'Client127' as [NAME],'HIGH RISK' as [RISK LEVEL]
union all
select 'Client128' as [NAME],'HIGH RISK' as [RISK LEVEL]
数据集2
select 'Client123' as [CLIENT NAME] , 'INCOMPLETE' as [REVIEW STATUS]
union all
select 'Client124' as [CLIENT NAME] , 'COMPLETE' as [REVIEW STATUS]
union all
select 'Client125' as [CLIENT NAME] , 'COMPLETE' as [REVIEW STATUS]
union all
select 'Client126' as [CLIENT NAME] , 'INCOMPLETE' as [REVIEW STATUS]
union all
select 'Client127' as [CLIENT NAME] , 'INCOMPLETE' as [REVIEW STATUS]
union all
select 'Client128' as [CLIENT NAME] , 'INCOMPLETE' as [REVIEW STATUS]
本报告中使用的表达方式
1. Lookup(Fields!NAME.Value, Fields!CLIENT_NAME.Value, Fields!REVIEW_STATUS.Value, "DataSet2")
2. count(Lookup(Fields!NAME.Value, Fields!CLIENT_NAME.Value, Fields!REVIEW_STATUS.Value, "DataSet2"))
3. count(Lookup(Fields!NAME.Value, Fields!CLIENT_NAME.Value, Fields!REVIEW_STATUS.Value, "DataSet2"))/Count(Fields!NAME.Value,"RISK_LEVEL")
4. Count(Fields!NAME.Value, "RISK_LEVEL2")
我创建了两个示例报告。我提到了 sample report1
的组属性。对于 sample report2
组 属性 和第一个一样。