Joined: 21 Jan 2011
Online Status: Offline
Posts: 107
Topic: count specific records formula Posted: 27 Mar 2013 at 11:20am
Hello
I need to do a distinct count of patientID's if a field value contains the word "methadone"
Im thinking i should do a running total
-Field to summarize select the field PATID
-Type of Summary select distinct count
-Evaluate i should use a formula but I can recall what is the proper way to write the formula if i only want to count records that have the word "methadone" in them
I think you could do it without a running total as well. Create a formula like below:
formulaname: PatientID
if {table.field} <> "methadone" then PatientID else "FALSE"
then create another formula to actually count the PatientID's. Only thing is, that it will also count the value FALSE. So you have to count it, minus 1
distinctcount({PatientID}) - 1.
If you want to use a running total, I think the formula should be something like
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum