Solved

How do I write the crystal syntax

Posted on 2011-03-23
3
524 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 35201303
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
ID: 35201332
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
ID: 35201777
Thanks I thought I could do this by wrapping formulas but this works really nice!!!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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 …
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

752 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