Print Page | Close Window

Very Interesting Crystal Problem - Please Help!!

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=16719
Printed Date: 03 May 2024 at 1:29am


Topic: Very Interesting Crystal Problem - Please Help!!
Posted By: DerekDOR
Subject: Very Interesting Crystal Problem - Please Help!!
Date Posted: 11 Jun 2012 at 6:15am
Hi all,
 
I've created a report that groups records by an equipment class code, then takes the total breakdown costs of each record in the group, totals it for the entire group, and displays the average breakdown costs for that class code group.
 
The problem that I'm having is once I find the average breakdown costs for the group, I want to take the breakdown costs for each record and devide it by the group average to come up with a percentage for each record. It is making the calculations, but most are not correct because it is calculating the data at the same time.
 
I realize that crystal calculates in a certain order every time, so I tried playing with creating multiple sections and using "Whileprintingrecords", "whilereadingrecords" and "evaluateafter" in the formulas to no avail. I even tried creating sub-reports both ways (setting and passing the variables to the sub-report and vice versa...)
 
I am at a complete loss, but I know someone has had a need to do something similar before; I can't be the only crazy person :) ! I really just need some suggestions or ideas as I've just been running in circles the last week or so.
 
If someone is willing to help me out, I am more than willing to give any details, images and formulas that you need to help me. I'm sure the information that I have given so far is vague since I'm the only person who has spent weeks working on this impossible yet needed report...
 
Thanks for any help!!!!!!!!!!!!!!!!!!!!!!!!



Replies:
Posted By: DerekDOR
Date Posted: 11 Jun 2012 at 10:07am
I'm really desperate... Any advice or ideas would be super helpful! Thanks again!!


Posted By: kevlray
Date Posted: 11 Jun 2012 at 10:17am
The only thing I can think of is having a subreport in the GH (you can also use that value in the FG) to do the average breakdown for the group (Pass the GH info to the subreport, then pass the average breakdown back through a shared variable).  I have no idea how much of a performance hit this will be on your report.

I hope this helps.


Posted By: DerekDOR
Date Posted: 11 Jun 2012 at 10:26am
Thanks so much for the advice kevlray! That is something I haven't tried yet; I will give it a shot.
 
I'm out of ideas so anything and everything will help!!


Posted By: DerekDOR
Date Posted: 15 Jun 2012 at 9:37am

kevlray,

Your suggestion did not work for me; however it did help me realize that I will not find a solution to this issue while using data that’s in database form.

 

HOWEVER, I did find a solution. I created a stored procedure which did the calculations for the average for each group and then connected to it as a data source (using the "Add Command" option in the Database Expert). So far, this seems to be satisfying my needs.

 

I truly appreciate your help and hope this information helps someone else with a similar problem!




Print Page | Close Window