Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports Do not count Duplicates

Status
Not open for further replies.

TammyG

Instructor
Feb 8, 2010
4
US
I work in Healthcare and need to count "people" who have been admitted to the hospital in the last year by race. My problem is that I can get this to do it by "visit"....a person could have visited the hospital numerous times in the year and I only want it to count once per person. Any help would be appreciated
 
Hi,
Try grouping on Year, placing the person in the details and insert a summary in the GF using 'Distinct Count' - you can then supress the display of the details.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Thanks for the thought but still not working for me. It is still counting the duplicates even if they are not showing (suppressed). Thanks for trying
 
Hi,
Is the patient identifier unique? In other words does the partient always have the same ID regardless of admission times?

If so, a distinct count of that ID should give you an non-duplicate count.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Each Patient has a unique MedRecNumber - the problem is I need to count the RaceCd for each MedRecNumber - this is the SQL I have if that helps. I really appreciate all you are trying to do.


SELECT DISTINCT "TPM300_PAT_VISIT"."med_rec_no", "TSM040_PERSON_HDR"."lst_nm", "TSM040_PERSON_HDR"."fst_nm", "TSM040_PERSON_HDR"."mid_nm", "TSM040_PERSON_HDR"."nam_sfx_cd", "TSM040_PERSON_HDR"."sex_cd", "TPM300_PAT_VISIT"."adm_ts", "TSM040_PERSON_HDR"."eeoc_cd", "TSM040_PERSON_HDR"."rac_cd"
FROM "paragon"."dbo"."TSM040_PERSON_HDR" "TSM040_PERSON_HDR" INNER JOIN "paragon"."dbo"."TPM300_PAT_VISIT" "TPM300_PAT_VISIT" ON ("TSM040_PERSON_HDR"."psn_int_id"="TPM300_PAT_VISIT"."psn_int_id") AND ("TSM040_PERSON_HDR"."man_int_id"="TPM300_PAT_VISIT"."man_int_id")
WHERE ("TPM300_PAT_VISIT"."adm_ts">={ts '2009-01-01 00:00:00'} AND "TPM300_PAT_VISIT"."adm_ts"<{ts '2009-12-31 00:00:01'})

 
Thanks so much - I GOT IT.....appreciate all your help
 
grouping them by patient then by year,

then the count is according to patient,

just a guess,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top