CHAPTER 6 BUILDING REPORTS
The other two requests were to be able to see the patient and employee totals for each diagnosis.
You can add an expression, CountDistinct, to the report that will count each unique patient and
employee and calculate the amounts at the diagnosis level. The syntax used for the patient count is as
follows:
=CountDistinct(Fields!FieldName.Value)
By adding the CountDistinct expression for the field PatID (which you know to be unique per
patient) as well as for the field EmployeeID, it will be much easier to see at a glance how many patients
with a specific diagnosis have received care.
Place the following two expressions for the Diagnosis group in the cells just below the Employee
Count and Patient Count header cells:
=CountDistinct(Fields!EmployeeID.Value) =CountDistinct(Fields!PatID.Value)
Though the report is still similar to the non-interactive report, with the drill-down additions it will
look much different when previewed (see Figure 6-11). In the screenshot in Figure 6-11, you will notice
that we hid the document map to provide more space for the report. You can show or hide the document
map by double clicking the tiny arrow in the center of the bar separating the document map and the
body of the report.
Figure 6-11. Report with interactive drill-down