首页 > 解决方案 > Report Builder charts - grouping data by a specific age group

问题描述

I have a pretty large dataset where learners are divided into age groups (16-18, 19+). I am trying to calculate the retention of learners (completed field/ Leavers field) and display the chart by just one of those age groups (16-18). How can I do this as an expression?

标签: reporting-services

解决方案


我会创建一个计算字段,您可以在其中存储不同的年龄组:

'Name: AgeGroups
=IIF(CInt(Fields!Age.Value) > 15 And CInt(Fields!Age.Value) < 19, "16-18", "19+")

现在将您需要的所有内容添加到图表中。现在Fields!AgeGroups.Value是大类。在过滤器下的图表属性中,您可以添加以下过滤器,以仅显示一个年龄组:

'Expression
=Fields!AgeGroups.Value

'Format
String

'Operator
=

'Value
16-18

这样,如果您的自定义分组有时发生变化,您只需在计算字段中应用一次更改。


推荐阅读