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

Trying to calculate percentage with Sum values 2

Status
Not open for further replies.

glthornton

Programmer
Oct 19, 2005
108
US
Hi,

Using Cystal Reports 10. I'm trying to calculate a "No Show" percentage in reference to appointments. I am using a cross-tab type report and I have values for each doctor. My cross-tab looks something like this:

January 2005 February 2005
TotAppts NoShows % TotAppts NoShows %
Dr Alpha 143 5 0 152 9 0
Dr Beta 211 19 0 229 23 0

Code:
The field for TotAppts is:  Sum of tblSeen_NoShowCounts.TotAppts (Number)
The field for NowShows is:  Sum of tblSeen_NShowCounts.NoShowCnt (Number)

I've been trying to create a formula for the percentage but anything I try comes out incorrect. Does anyone have any suggestions with this. My biggest misunderstanding is how I can identify and use the calculated values that Crystal Reports shows within the tabbed fields.

Any ideas would greatly be appreciated.

GlThornton
 
Create a formula {@percent}:

if {tblSeen_NShowCounts.NoShowCnt} > 0 then
{tblSeen_NShowCounts.NoShowCnt} % {tblSeen_NoShowCounts.TotAppts}

Insert this as a summary field and choose weighted average as the summary. Choose {tblSeen_NoShowCounts.TotAppts} as the weight. In preview mode, click on the % icon to get the correct display.

-LB
 
Awesome LB!!!

That worked perfectly. Is there any way to setup this formula field to have 2 decimal points rather than having it round the value to a whole number?

GlThornton
 
You should be able to click on the field in preview and use the icon for increasing decimal places or else right click->format field->set the decimals.

-LB
 
You're correct LB, but I needed to make 2 slight adjustments and not just 1. When I right clicked and went into format field, I had to change it in 2 areas or else it would not work. I first changed the Rounding field from 1 to 0.01 and the Decimals field from 1 to 1.00. If I did one or the other, the none rounding function would not work.

Now that I've got this process down, from here on out should be a breeze....

Thanks LB!!

GlThornton
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top