0
votes

I have Crystal Report DistinctCount function, and i want to convert it to SSRS CountDistinct The below expression is in Crystal Report;

{Prod.mID} + " Total Patients: " + Totext(DistinctCount({Prod.A},{Prod.B}),0,"")

I have made this so far, but not able to implement it in SSRS report;

=Fields!B.Value & "Total Patients: " & CountDistinct(cstr(Fields!A.Value) + cstr(Fields!B.Value),0,"")

Any suggestions as to how to achieve this. Where am i going wrong. Appreciate it.

1
Can anyone help me out with this please. I am at the verge of completing my Report, except this one, where i am stuck and its blowing my head off. - Niki

1 Answers

0
votes

I'm not sure how the Crystal Reports DistintCount works but the 2nd (optional) argument for the SSRS CountDistinct function is for the group Scope and the 3rd is whether it's recursive. I don't think you need either (if you do, they are flipped around).

=Fields!B.Value & "Total Patients: " & CountDistinct(cstr(Fields!A.Value) & cstr(Fields!B.Value))

MSDN - CountDistinct