Print Page | Close Window

Percentage 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=22860
Printed Date: 19 Apr 2024 at 7:26pm


Topic: Percentage line chart
Posted By: victoria61485
Subject: Percentage line chart
Date Posted: 04 Feb 2020 at 5:15am
Hello,

I have a report with an ID number field called BABY_MRN. I also check a criteria for the record for each BABY_MRN and if these records meet the criteria another field, COLD_IN_TIME_FRAME, is populated with a 1 for that BABY_MRN. I would like a line chart that shows, for month to month, the percentage of BABY_MRN's where COLD_IN_TIME_FRAME, is populated with a 1, vs the total number of BABY_MRN's. I have been able to build a line chart that shows month to month the sum of BABY_MRN's where COLD_IN_TIME_FRAME, is populated with a 1, but I need what percentage this represents to the total. Any help would be greatly appreciated!



Replies:
Posted By: hilfy
Date Posted: 06 Feb 2020 at 4:51am
To get a percentage, you need to do more than just sum. I would create a formula that looks something like this (assumes that you have a group on the date that's set to view monthly):

Sum({table.COLD_IN_TIME_FRAME}, {table.DateField}, "monthly") % Count({table.BABY_MRN}, {table.DateField}, "monthly")

This will display the values and might work in the chart. Also, the "%" operator will automatically give you a percentage that automatically multiplies the result by 100 instead of you having to explicitly do the multiplication in the formula.

-Dell

-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: victoria61485
Date Posted: 13 Feb 2020 at 3:43am
Thank you! I will try that.



Print Page | Close Window