Solved

how to create chart using data points from calculated formula

Posted on 2004-04-14
7
1,329 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now