Percentage breakdown in a bar char

Printed From: Crystal Reports Book — Forum Name: Technical Questions


I need to display a bar chart that is broken down by percentage wise. Here is a sample data

All Completed activity under 30 mins

Req ID     Employee TAT(Mins)
1     A     29
2     A     28
10     B     25
11     B     27
13     B     31

A - 2/2= 100% B 2/3 = 67%

In the chart I need by employee and their completed activity percentage in Green and not completed activity in red.

A is all green
B is 67% green 33% red.

I couldn't able to post the image here, I hope this helps.

Thanks
This is an interesting challenge!

You'll need to use a stacked bar chart and you'll place it in an Group or Report Footer (or possibly Header - NOT in Details!) You'll also need an employee group so that you can count the number of requests per employee.

Then you'll need something like these formulas:

{@NumComplete}
if {MyTable.TAT} < 30 then 1 else 0

{@NumNotComplete}
if {MyTable.TAT} >= 30 then 1 else 0

{@PercentComplete}
if DistinctCount({MyTable.RequestId}, {MyTable.EmployeeGroupField}) > 0 then
Sum({@NumComplete}, {MyTable.EmployeeGroupField}) % DistinctCount({MyTable.RequestId}, {MyTable.EmployeeGroupField})

{@PercentNotComplete}
if DistinctCount({MyTable.RequestId}, {MyTable.EmployeeGroupField}) > 0 then
Sum({@NumNotComplete}, {MyTable.EmployeeGroupField}) % DistinctCount({MyTable.RequestId}, {MyTable.EmployeeGroupField})

You'll then graph the two "Pct" formulas per employee and change the color of the bar to green and red.

-Dell
Thank you very much for your help :)