Solved

How do I write the crystal syntax

Posted on 2011-03-23
3
535 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 101

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 101

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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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…
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 …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

635 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