Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Top N Group Post Reply Post New Topic
Author Message
ViperSBT
Newbie
Newbie
Avatar

Joined: 02 Jul 2009
Location: United States
Online Status: Offline
Posts: 12
Quote ViperSBT Replybullet Topic: Top N Group
     Posted: 29 Sep 2009 at 2:47pm
Here is a sample of my current report:

PartNum   PartDescription   CountedDate
Area 51                
                         
299460   BURR 93336  1/4 TREE RADIUS      
298830   BACK PAD NO HOLE 3-2/3 x 7      
297360   SAND 3-2/3 x 7   180 GRIT PS33      
000013-001   AS1 Accessory Shelf      
                         
    A              
W-HRCP7400   7400 HOT COLD PAN   6/25/2009
W-HRCP7500   HOT COLD 7500 PAN   6/25/2009
W-RCP7500   RCP 7500 COLD PAN   6/25/2009
W-RCP7300   RCP 7300 COLD PAN   6/25/2009
W-HRCP7200   HOT COLD 7200 PAN   6/25/2009
W-RCP7600   RCP 7600 COLD PAN   6/25/2009
W-RCP7400   RCP 7400 COLD PAN   6/25/2009
W-RCP200   RCP 200 COLD PAN   6/25/2009
W-HRCP7600   HOT COLD 7600 PAN   6/25/2009
W-ICP600   ICP 600 COLD PAN   6/25/2009
W-RCP7200   RCP 7200 COLD PAN   6/25/2009
W-RCP100   RCP 100 COLD PAN   6/25/2009
W-HRCP7300   HOT COLD 7300 PAN   6/25/2009
W-RCP7100   RCP 7100 COLD PAN   6/25/2009
W-RCP300   RCP 300 COLD PAN   6/25/2009
W-RCP400   RCP 400 COLD PAN   6/25/2009
W-RCP500   RCP 500 COLD PAN   6/25/2009
W-RCP600   RCP 600 COLD PAN   6/25/2009
000004-0029   Meat Box Cold Pan   7/21/2009
518445   PERFORATED METAL 3/8"DIA-1/2"STG CTRS.(5) HOLES PSI 52% O/A  4' x 10'   8/5/2009
             
139897   WELLS MANUFACTURING HOT/ COLD KIT HRCP-7300 #504886, CAPABLE OF HOLDIING THREE PANS 46-1/2" X 27-1/8",                                                        R-404A REFRIGERANT, 208/240V   8/25/2009
             
             
             
                         
    B              
043091   DRAWER ASSEMBLY #S90-0015-N 15" S/S   5/22/2009
645630   CUTTING BOARD YELLOW         
1/2" THICK X 4 X 8
  6/25/2009
             
W-ICP100   ICP 100 COLD PAN   6/25/2009
W-ICP200   ICP 200 COLD PAN   6/25/2009
W-ICP300   ICP 300   6/25/2009
W-ICP400   ICP 400 COLD PAN   6/25/2009
W-ICP500   ICP500 COLD PAN   6/25/2009
516737   ALUMINUM, .063 5 X 10 ALUMINUM SHEET   6/25/2009
516734   .090 60 X 120 3003 BRUSHED ALUMINUM   6/25/2009
The first group is my warehouse and the second group is a part classification.  I have multiple warehouses and multiple part classifications.  My select statement is simply a check to look for parts that have a last count date more than 30 days ago.  This returns thousands of lines...

What I need is to only take the "First N" of each Warehouse.  I know that saying first is not correct because you can't really identify which record is first.  So more correctly I guess I need to say that I want to limit the report to only showing me the first 50 records of the Warehouse Group and then show the next Warehouse Group.

Is this doable?  Should I be looking at this in a different way?
IP IP Logged
Jyothi Yepuri
Senior Member
Senior Member


Joined: 11 May 2009
Location: Australia
Online Status: Offline
Posts: 127
Quote Jyothi Yepuri Replybullet Posted: 29 Sep 2009 at 5:45pm
Create a formula to count records under group2 --place this in details and supress details, Group2 with the condition
@cnt >50


//Cnt
Shared numbervar cnt;

IF ONFIRSTRECORD
OR   PREVIOUS( {warehouse} ) <>GroupName ({warehouse}) THEN
Cnt:=1
else
cnt:=cnt+1


HTH,
Jyothi

IP IP Logged
ViperSBT
Newbie
Newbie
Avatar

Joined: 02 Jul 2009
Location: United States
Online Status: Offline
Posts: 12
Quote ViperSBT Replybullet Posted: 30 Sep 2009 at 4:26am
Thank you very much Jyothi, that did the trick perfectly!
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum