Print Page | Close Window

NthLargest

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=15638
Printed Date: 28 Apr 2024 at 7:52am


Topic: NthLargest
Posted By: AndyLeates
Subject: NthLargest
Date Posted: 15 Feb 2012 at 2:34am
I have the following formula in my report:
 
NthMostFrequent (1,{vTASKS_BROWSE.WOTYPE3}, {vTASKS_BROWSE.TYPE} )
 
WOTYPE3 is the category of a ticket on our Service Desk
TYPE is group "Incident" or "Service Request"
 
When I browse the data, I correctly see two values, the highest category for Incidents and the higest for Requests.
 
I really want to be able to work with each result in turn. Can I specify in the formula, just give me the highest value for this group? Something along the lines of below (which does not work!!)
 
NthMostFrequent (2,{vTASKS_BROWSE.WOTYPE3}, {vTASKS_BROWSE.TYPE = "Incident"} )
 
Thanks for any pointers
 
Andy



Replies:
Posted By: DBlank
Date Posted: 15 Feb 2012 at 3:37am

if you place your formula field in the group header or footer then it will return the value you want in each of the groups. You can conditionally suppress the one you do not want to appear.

you can use a running total to get the value you want using an evaluation formula but this can only be used in footers.
 
You can create a formula field to 'remove' (null) the all rows that are not incident rows and do the NthMostFrequent on that formula field.



Print Page | Close Window