Print Page | Close Window

Getting Percentages to show on a Line Chart

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=23009
Printed Date: 28 Apr 2024 at 8:56pm


Topic: Getting Percentages to show on a Line Chart
Posted By: Tonyak74
Subject: Getting Percentages to show on a Line Chart
Date 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.



Replies:
Posted By: kevlray
Date 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.


Posted By: Tonyak74
Date 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.



Print Page | Close Window