Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Percentage breakdown in a bar char Post Reply Post New Topic
Author Message
achandana01
Groupie
Groupie
Avatar

Joined: 20 Jul 2011
Online Status: Offline
Posts: 59
Quote achandana01 Replybullet Topic: Percentage breakdown in a bar char
    Posted: 16 Apr 2018 at 4:26am

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
chand
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 16 Apr 2018 at 1:11pm
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
IP IP Logged
achandana01
Groupie
Groupie
Avatar

Joined: 20 Jul 2011
Online Status: Offline
Posts: 59
Quote achandana01 Replybullet Posted: 19 Apr 2018 at 10:37am
Thank you very much for your help :)
chand
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.