Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Getting Percentages to show on a Line Chart Post Reply Post New Topic
Author Message
Tonyak74
Newbie
Newbie
Avatar

Joined: 24 Apr 2013
Online Status: Offline
Posts: 28
Quote Tonyak74 Replybullet Topic: Getting Percentages to show on a Line Chart
    Posted: 01 Jul 2022 at 8:22am
I am working on a report counting open and closed Work Orders.
I am trying to create a line chart to show the percentage of closed for each Quarter.
I have only been able to get the counts to show up.
When I try to do a formula for the percentage it is not a data option in the list when creating the chart.
Any assistance would be appreciated.

Edited by Tonyak74 - 01 Jul 2022 at 9:31am
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 05 Jul 2022 at 4:27am
It is hokey at best.  But here is what I had to do.  i created a formula that looks something like this.

sum({amount to be summed},{column breakdown)/sum({amount to be summed}

Depending on your data, you may need a check for zero (do not want to divide by zero).

Also I changed the axis able to be a percentage and the data label to be a percentage.  There was a lot of trial and error until I got it to work.  Lots of luck.
IP IP Logged
Tonyak74
Newbie
Newbie
Avatar

Joined: 24 Apr 2013
Online Status: Offline
Posts: 28
Quote Tonyak74 Replybullet Posted: 14 Jul 2022 at 6:25am
Thank you Kevlray.
I appreciate the assistance. You got me on the right track.
I just want to post the following for anyone else struggling with this.
Since I was only counting closed WO I created a formula for closed. Basically, it said if closed is True, then give me the WO #.
Since it was showing the WO # I had to do a distinct count instead of a summary. This gave me the correct value, but I was not able to get it to show the % sign on the chart.

I found the following information on google, which helped me to display the % sign in the legend

https://stackoverflow.com/questions/54039324/how-to-display-percent-symbol-in-y-axis-value-in-crystal-report-line-char

And this one I used in my formula to get the correct position of the percent symbol

http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4830

My final formula looked like this:
DistinctCount ({@closed}, {WorkOrder.RequestedOn}, "quarterly")% Count ({WorkOrder.WorkOrderKey}, {WorkOrder.RequestedOn}, "quarterly")/100

Hope this helps.
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.016 seconds.