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!

New to Crystal - Percentage Question 1

Status
Not open for further replies.

Secretgeek

Technical User
Jan 3, 2008
80
GB
Hi,

As stated I'm brand new to Crystal but have some basic Access and VB knowledge.

I need to show the percentage of cases that have passed their deadline as part of my report.

The actual formula for doing this shouldn't be a problem as it would be something along the lines of:

100 * (Count(Main.ID) Where (Main.ClosedDate > Main.Deadline)/Count(Main.ID))

However, despite much head scratching and experimentation I just can't figure out how to achieve this in Crystal.

Any help would be much appreciated as this needs to be done before the end of today.

Thanks in advance for your help.
 
Do this in two steps. Create a formula:

{@passeddeadline}:
if {Main.ClosedDate} > {Main.Deadline} then 1

Then create a second formula for the percentage:

sum({@passeddeadline}) % count({Main.ID})

This percentage would be at the report level. if you need it at a group level, you would use:

sum({@passeddeadline},{table.groupfield}) % count({Main.ID},{table.groupfield})

-LB
 
Many thanks lbass. That's giving me what I need. Also found an earlier post of yours relating to percentages and Cross-tabs that very useful too.

It didn't seem to like me putting {@passeddeadline}:
into the formula section but I guessed that that was just a suggestion for the formula name, took it out and it works fine.

Thanks again.

I enjoy learning new things but why does it always have to be learnt on a Friday afternoon?! :)

 
Yes, that was the formula name. I usually comment them out in the post, but forgot this time:

//{@passeddeadline}:

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top