Solved

how to create chart using data points from calculated formula

Posted on 2004-04-14
7
1,360 Views
Last Modified: 2012-06-27
I have linked tables that show patients, labs, and values over time.  the following formula suggested by "EE" Peter, works to give me the number of patients who have a certain labtest type & result within a given range.  using this and similar formula i am able to get an overview patient population.  i would like to display these results in a chart format, yet whenever i try to use a formula field in a chart, i receive the message "A print time formula that modifies variables is used in a chart or map"

i thought i could use the Nth largest of the formula, or the maximum or Last.  i'm unsure what direction to go next.  i need to have the "chart-able" numberic result equal to the total number of patients whose labs fall into each of the different ranges.

numbervar knt1;
if {mytable.mydate}= Maximum ({mytable.mydate}, {mytable.PatientID}) and
{mytable.Labvalue}< 6.5 then
Knt1:= Knt1+1;
knt1
0
Comment
Question by:ellendavidson
  • 3
  • 3
7 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 10827844
Which section are you putting the report in?

mlmcc
0
 

Author Comment

by:ellendavidson
ID: 10828363
i have only tried putting the report in the Report Header
0
 
LVL 42

Expert Comment

by:frodoman
ID: 10829341
I think you're trying to use variables in a chart that are still being updated at the time the chart is being rendered.

One way to work around this would be to create a subreport with as many parameters as the number of values you're looking for (This only makes sense though if you have a reasonable number of values to pass - you don't want to have to pass 100 parameters!).  Create a chart in this subreport based on the parameter values.  Now insert the subreport into the report footerB of the main report and link the final values of the variables to the subreport's parameters (You can't actually link a variable - you'll want to create formulas in the report footerA that return the variable's values and link these formulas to your parameters).

I don't have Crystal on this PC so I can't work out exact syntax but hopefully this is enough to get you started.

frodoman




0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

Author Comment

by:ellendavidson
ID: 10837019
hi frodo-man
i read your solution and thought Eureka! Aha! yes, of course that's it.  but the translation into making crystal reports perform the way i want is just not happening.  there must be a way, and i am just not approaching this correctly.

i have a formula that creates a value [count the number of patients whose latest lab value falls within a certain range].  i would like to include the formula result and the others like it, in pie chart form, to show the breakdown of lab values across a patient population.

any ideas?
0
 
LVL 42

Expert Comment

by:frodoman
ID: 10842459
Sorry - I got focused on the formula that you already had and neglected the easy approach...

Create one formula called "Catagory" like this and drop it into the details section of your report:

if {mytable.Labvalue} < 6.5 then
(
    "Less Than 6.5"
)
else
(
    If {mytable.Labvalue} >= 6.5 and {mytable.Labvalue} < 12 then
    (
         "6.5 - 12.0"
    )
    else
    (
         "Over 12"
    )
)

Now just insert your pie chart and set it to "OnChangeOf" = @Catagory    and "ShowValues" = Count of @Catagory.

I believe that'll give you your pie chart.  You can of course suppress the @Catagory formula so it isn't visible on your report.

frodoman
0
 

Author Comment

by:ellendavidson
ID: 10861335
hi frodo man
that gives me a beautiful chart.  thanks.  one more question though.  in my list of lab values, patients will have more than one date with result.  the chart is counting labs that don't fit into one of the three categories (since they are not the latest lab results for the patient(s), and giving me a fourth section of the pie.  the first three sections of the pie, count accurately the number of latest labs that fit into that category, the fourth pie slice has no label.  how can i exclude the values that are not the latest lab values?
e.
0
 
LVL 42

Accepted Solution

by:
frodoman earned 400 total points
ID: 10868203
Open up the chart expert and hightlight "catagory" under the "on change of" area, then click the 'Order' box.  Select "specified order" from the dropdown (it probably shows ascending right now by default).  Now, just add the catagories that you want to appear on the report.  

For the first one click "New", then type "Less Than 6.5", then for the criteria enter {@Catagory} = 'Less Than 6.5', etc.  Basically you're explicitly naming the groups that will appear on the chart and the order in which they'll appear.

After naming all the ones you want, click the "Others" tab and select the option to "discard all others" - this will get rid of the unwanted 4th grouping.

frodoman
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question