Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RE: show only first 30 records for each bid continued

Status
Not open for further replies.

allyne

MIS
Feb 9, 2001
410
US
Hi Everyone,

Now that I have 30 records on one page for each bid I need a total for just those 30 records for each bid. Thought I had this one solved but being a very newbie to CR I spoke to soon :( Here is short example of what I need.

SID/BID 01645 (Grouped BY)
NAME SID Current 30 60 (FieldNames)

ATT 411 30.00 20.00 10.00
United 211 18.00 30.00 30.00
(There are hundreds of records that show up under the SID/BID 01645 That is now suppressed)

(Now I need to add fields that sums the top 2 records for each field)

Subtotal 48.00 50.00 40.00

SID/BID 4444(Grouped BY)
NAME SID Current 30 60 (FieldNames)

GTE 210 30.00 20.00 10.00
BELL 215 18.00 30.00 30.00


(There are hundreds of records that show up under the SID/BID 01645 That is now suppressed)
(Now I need to add fields that sums the top 2 records for each field)

Subtotal 48.00 50.00 49.00

Is there a way to do this? If so, can you please show me the correct syntax. I can't seem to get this to work now that the records are suppressed.

Thanks again for all your time and help!

 
allyne: Your solution to summing only the first 2 values in each bid is as follows:

1. Create a Running Total {RTotal1} which does a Distinct Count of Value, evaluate On Change of Value and reset on Change of Group1 (Bid)

2. Create a formula field as follows:
numbervar first2:=
if {#RTotal1} = 1 then
first2:=Maximum ({Value}, {Value})
// or however you got your Top 30 records to show
else
if {#RTotal1} =2 then
first2:=first2+Maximum ({Value}, {Value})
else
first2:=first2


Hope this helps David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Hi David,

Thanks for your help! I'll give it a try Monday.
 
Hi David,

I tried the If statement you gave me but it didn't work.

The way I got the top 30 records is as follows:

Created a running total with a count on Bid, evaluate for each record and reset on change of group.

I then went to design view and under suppress I entered the following formula: {#RunningTotal}> 30

Thanks again for all your time and help.
 
Sounds like you need a total of each page that resets at the top of each page.

You need a 3-formula running total to do this. See the FAQ on running totals and look at the 3-formula technique.

The reset formula goes in the page header, the accumulating formula goes in the detail (and can be hidden), and the display formula goes in the page footer. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Ken,

Thanks for the Info. I'll give it a try.
 
Ken,

Thanks for pointing me in the right direction. The 3-formula running total is what I needed!

Thanks Again! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top