Solved

How do I write the crystal syntax

Posted on 2011-03-23
3
479 Views
Last Modified: 2012-05-11
Hi, I am building a report that is group by a pat_id and lab dates with results for each of the dates.  For example, id#xxxx08 seen on 09/06/2008 with a result of 5.60
                                                                  02/11/2009 with a result of 7.10
                                                                   01/1/2010 result 11.0
I can write the formula to get the max date with this:
maximum({RESULT_DATE},({PAT_ID}) )
which will give me 01/11/2010 but how do I write the formula to pick up the 11.0? (ord_num_value)
0
Comment
Question by:Kathy_O
  • 2
3 Comments
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
There is no easy formula to get it however, if the order of the data isn't important you can sort by the date and then the record in the group header (descending sort) or footer (ascending sort) will have the value.

mlmcc
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
Comment Utility
If you need them in some other order then you could use a set of formulas like

In the group header add a formula
WhilePrintingRecords;
Global DateVar grpMaxDate := maximum({RESULT_DATE},({PAT_ID}) );
""

In the detail section
WhilePrintingRecords;
Global DateVar grpMaxDate;
Global NumberVar ord_num_value;
If {RESULT_DATE} = grpMaxDate then
      ord_num_value := {ord_num_value};
""

In the group footer
WhilePrintingRecords;
Global DateVar grpMaxDate;
Global NumberVar ord_num_value;
ord_num_value

mlmcc
0
 

Author Closing Comment

by:Kathy_O
Comment Utility
Thanks I thought I could do this by wrapping formulas but this works really nice!!!
0

Featured Post

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.

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. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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

18 Experts available now in Live!

Get 1:1 Help Now