Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: one to many - counting Post Reply Post New Topic
Author Message
TorLang
Groupie
Groupie


Joined: 13 Jun 2012
Location: United States
Online Status: Offline
Posts: 50
Quote TorLang Replybullet Topic: one to many - counting
     Posted: 14 Jun 2012 at 7:07am
Hopefully I can explain this so you understand what I am trying to do.

I am working on a patient billing report.
My issue is that a patient can have a procedure done 1-2-3-4 times.

It will look like this if I don't distinct:

procedure 1: Quantity: 1
procedure 1: Quantity: 1
procedure 1: Quantity: 1

I need the result to look like this (distinct):

procedure 1: Quantity 3

I have the billing data all on one detail page pr. procedure, so when the procedure number changes, it shows on next page, along with all patient demographics etc. I just don't need 3 pages for a procedure done 3 times, when I can count it and put the count on one page. I just don't know how.

How can this be done?

Appreciate any assistance.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 14 Jun 2012 at 7:10am
why not group on the type of procedure instead of the procedure number...that way you will only get 1 report per procedure.
 
hopefully there is a field for the type of procedure...
if so, probably nothing else in the report needs to change.
 
HTH
IP IP Logged
TorLang
Groupie
Groupie


Joined: 13 Jun 2012
Location: United States
Online Status: Offline
Posts: 50
Quote TorLang Replybullet Posted: 14 Jun 2012 at 8:00am
I will need to group on the procedure number, because the report requires a page per procedure (with the count). Do I then make a group on procedure number? Where would I put the group? header, footer..
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 14 Jun 2012 at 8:34am
i don't know...
 
a group always goes in the body of the report...it creates its own header and footer. Page and report header/footers belong to the report (in its entirety) and to the page.
 
this is why I say I don't know...
you don't want to repeat the data 3 times because a procedure number changed, but you need a page per procedure number (it sounds like).
Since you need demographics, which don't sound like they are summary values, you need the detail section to display, so it seems like you are stuck in a quandry...
IP IP Logged
TorLang
Groupie
Groupie


Joined: 13 Jun 2012
Location: United States
Online Status: Offline
Posts: 50
Quote TorLang Replybullet Posted: 14 Jun 2012 at 10:23am
Can I use a Running Total field?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 15 Jun 2012 at 10:20am
the basic problem...as I understand it, is the 3 pages of repeated data. If you have no way of reducing that, nothing is really going to help...since that seems to be the basis of your issue, the duplicated data.
 
grouping, running total, shared variables, just different ways to get a number, but they won't change the data being displayed
 
if I am missing something let me know, but it seems that you have said that the values displayed are correct, just the data is repeating...but that you need it to repeat to be accurrate
IP IP Logged
TorLang
Groupie
Groupie


Joined: 13 Jun 2012
Location: United States
Online Status: Offline
Posts: 50
Quote TorLang Replybullet Posted: 19 Jun 2012 at 7:15am
I guess I didnt explain the problem :-). Lets say on the billing report there are 2 insurance companies for a patient, a primary and a secondary. I am getting 2 records for this patient simply because the patient has two insurances. I need both insurances on the same page, instead of getting 2 records (two pages) with an insurance on each.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 20 Jun 2012 at 7:06am
OK, it all depends on how your report is designed.
 
If you are looking at patients, then you should see the 2 records there, but if you a grouping by insurance company as well, you should see the appropriate record for each insurance company.
 
You have 2 records with various identifiers, and depending on how your report is designed will dictate how the records appear...you can only slice so many ways.
 
It sounds like you want to group by patient, so all of your records are together...but if you need to have a listing by insurance company, then this won't work...
 
if you want the data duplicated on the report, you could put your patient info into a subreport so that if it matches 1 insurance you get both records...
 
it all depends what you need/want the report to do
IP IP Logged
TorLang
Groupie
Groupie


Joined: 13 Jun 2012
Location: United States
Online Status: Offline
Posts: 50
Quote TorLang Replybullet Posted: 22 Jun 2012 at 12:48am
Ok, Thanks. Here is what I did: Grouped by Procedure, then by quantity. Make a running total field on quantity, evaluate on record, reset on procedure. Move the entire report into the Group Footer, and bingo, I get the procedure count on one page (grouped by procedure)
IP IP Logged
Printable version Printable version

Forum Jump
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