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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting the Percent for each Facility Per Month

Status
Not open for further replies.

bpxmas

Programmer
Nov 12, 2008
29
US
I'm working with Crystal X, I'm fairly experienced with the program itself.

I have a monthly report grouped by Doctor & Facility for Patient Visits for each Doctor. The total visits for each month are calculated in 'Running Totals' in the Facility Group Footer which works perfectly. I have two groups
1)Doctor, 2)Facility. Below is what the report looks like I need the %.
Dr. Jones
Facility Jan#Visits % Feb#Visits % Mar#Visits %
Plano 18 3.27 25
Coppell 533 96.73 411
Mth Total 551 436

Running Total
Field to summarize - cus.PatientVisitCount
Type of summary - Count
Evaluate - formula {cus_resenc;1.VisitDate} in DateTime (2010, 01, 01, 00, 00, 00) to DateTime (2010, 01, 31, 00, 00, 00) & same for Feb, etc.
Reset on Change of Group - Facility

The problem I'm having and need help on is getting the Percent (%) for each month (i.e. 01/01/2010 - 01/31/2010, etc.)for each facility. I've tried using formulas
IF({cus.visitdate} IN
Date (2010, 01, 01) to Date (2010, 01, 31))
THEN Count ({cus.Facility}, {cus_resenc;1.Facility}) /
Count ({cus_resenc;1.PatVisitCount}) * 100.0;

I've tried everything I can think of to get the percent. Any help would be greatly appreciated. Thanks in advance for your help.
 
I think you need a summary total for the entire value. You can also use them for months, much easier and quicker than using a running total. But using a formula field to calculate a percentage from a running total and a summary total should work.

The use of Crystal's automated totals is outlined at FAQ767-6524.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
You should create formulas like these:

//{@Jan}:
IF {cus.visitdate} IN Date (2010, 01, 01) to Date (2010, 01, 31) THEN 1

Then use a formula like this for the January facility percent:

sum({@Jan},{table.facility})%sum({@Jan},{table.doctor})

Repeat for other months.

-LB
 
LB,

So I shouldn't use Running Totals to get Patient Counts for each month? When I use the formula above for each month I get 0.00. Maybe I'm not understanding where I should place each monthly formula.

I appreciate your help. Thanks again.
 
The first formula goes in the detail section. The second formula goes in the facility header or footer--make sure you click on the % icon in the toolbar and add a couple of decimals if necessary.

Running totals should only be used when you can't use other methods. If you set up the running totals to count visits, evaluate for each record, reset on change of facility and you got the correct results, then you don't need a running total--as long as you are not using group selection.

The problem with running totals is that they only give you the correct result in the footer, so you would not have the value you need for the denominator in an earlier section.

-LB
 
LB,

It worked perfectly, thanks so much for your patience and help.

Brenda
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top