Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Charting a Formula

Status
Not open for further replies.

sdevlin

Programmer
Aug 17, 2002
6
US
Hello,

I am trying to create a pareto chart based on a formula.

the report I am working on has two groups
group A:product Line
group B:Test

in the report Header I use a formula to initialize a variable
@declare
shared numbervar aggYield:=1;

int the groupA header I reset aggYield
@initialize Yield
shared numbervar aggYield:=1;

I have group B footer split into two sections, in section 1 I have TestYield formula (Passed Tests over total Tests)
@TestYield
shared numbervar testYield :=(Sum ({@pass},
{FULL_TRF_TEST_View.Test Operation Name})) /
(Count ({FULL_TRF_TEST_View.Test Operation Name},
{FULL_TRF_TEST_View.Test Operation Name}));

in section 2 of Group B footer I have a suppressed formula
This keeps a running product of all if the testYields in each group A(product line)

@set Yield
shared numbervar aggYield;
shared numbervar testYield;

if testYield <> 0 then
aggYield := aggYield * testYield;


Then finally in group footer A I display the
@Aggregegate Yield
shared numbervar aggYield;

if true then
aggYield * 100

All of the Details, data, and caclculations show up just fine, however, I can not make a chart based on @aggregate Yield, I want to make a Descending pareto, where @aggregate yield is displayed on change of group A (Product Line)

Is this possible?




 
This might help you...


I'm trying to do the same thing without much success. I have formulas.. based on other formulas.. that run in group footer sections and the way the charting works it just will not display the correct values because the formula is evaluated &quot;whileprintingrecords.&quot;

The pdf I linked up there talks about making formulas that are concatinated strings of all the data you want to chart.. and you link those formulas to a subreport and make the chart there by using some split function. I'm as far as getting the correct string and passing them to the subreport but beyond that... it won't parse the strings correctly. Maybe if your formulas are straight out of the detail section and aren't grouped 50 ways like mine are.. you might have success with this method.

Wish I could help more.. but I'm a total newbie with crystal.
 
Sheadog,

We came up with a non-crystal based workaround. Its not really what I wanted to do, but hey, it got the darn chart to the customer. I wrote a stored rpocedure that reads through all of the raw data, and pours all the caluated results into a new SQL table. Then I setup a scheduled task to run the procedure every morning. Since our reporting database is always a day behind our production system, we could then chart on yesterdays data. Don't know if this is a solution for you or not. Toodles!

 
That's exactly what I ended up doing! Spoon feeding Crystal the pre calculated data from SQL so it wouldn't barf when it came time to chart it.

I also found I could generate the data in Crystal, export it to Excel, and chart it there fairly easily. Selecting the columns of data is all you really have to do in Excel. It's jumping through a lot of hoops, but then again... so is all the SQL required to get this to work. I didn't end up using this solution for consistancy reasons. We decided to keep it all in SQL/Crystal... but if you needed a chart quickly... this might be the way to go.

Glad we both found solutions for this! Seems like Crystal might want to address this issue!
 
Great Minds think a like, those are the same reasons we didn't go the Excel Route. Happy Reporting Sheadog!
 
CRChart was a great find! Over 100 different types of charts to choose from. Completely Customizable! Great Recommendation!

Ben Boyd
Technical Writer/Programer/Student
opspeedydude@hotmail.com
Linuxbox Server Stats: 700mhz, 1024 MB RAM, 120 GB HD, Fedora 3
Laptop Stats: 2.0 Ghz, 1024MB RAM, 40GB HD, Windows XP Professional
Desktop Stats: 2.6 Ghz, 2048MB RAM, 3 x 120 GB HD, ATI Radeon x800 Pro, Windows XP Media Center Edition
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top