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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Random 35 records from each group 1

Status
Not open for further replies.

djieon

Technical User
Aug 19, 2008
107
0
0
GB
Hi all,

I have a report that has data in the details section, and in the details section I have added the rnd () command.

My group one is 3 cities, London, new york and Bristol. (field name is {RM_AREA})

I want a total of 105 records, and I want the records to be randomly picked, but I want an equal amount from each city (ie 35)

Is there a way to do this?

Thanks.

David.
 
Sort within each group by the random value.
Suppress beyond record 35 in each group.

My FAQ about this is at: faq149-3261

hth,
- Ido

view, export, burst, email, and schedule Crystal Reports.
 
Create a running total that counts every record and resets on change of group and then use that in the section suppression formula area, after sorting as Ido suggested.

-LB
 
Hi both, thanks for the help.

ok I think this is a little more complicated than first thought..

my report looks like this

GH1 - Area (options, new york, london, bristol)
GH2 - Town (ie bronx, manhatten, etc...)
GH3 - Street (ie high street bronx, high street manhatten etc...)

In GH3 is where all the report is actually run and all the fields are as I have the details supressed, the reason for this is i am only allowed one record per street name

My user will use the paremeter to select the areas, and I want 35 records per area. however I want it to still group or sort by the town and then street so that the records come out in a logical order for issuing to our contractors (ie they visit all the records in the bronx first, then the ones in manhatten)

Is this possible? I could not see a way of adding a group sort...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top