1 of 1 people found this helpful
The reason that calculation is not working is because when one field in a calculated field is aggregated (in this case countd is the aggregation on EpisodeID), all of the fields must be aggregated. One way around this is to place attr() around each instance of [patientreached]:
IF attr([patientreached]) = "Y" then countd([EpisodeID])
elseif attr([patientreached]) = "N" then countd([EpisodeID])
elseif attr([patientreached])= "W" then countd([EpisodeID]) else 0 end
Hope this helps!
I hadn't tried the attr() function before, but unfortunately it is coming up with null values. I do have a few ideas of splitting up the calculated fields that may be able to solve the issue. Thanks again for the quick reply.
You could also try max or min instead of attr for the calculation--if there are multiple rows for the one field, attr will return nulls as you found.