Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Random selection from Crystal

Random selection from Crystal

Random selection from Crystal

I've created a Crystal report which returns about 200,000 records.  I now need to select a random sample of 10,000 records from that.  Does anyone have any suggestions?  I've tried using the TopN function but that was unsuccessful.
Can anyone help?



RE: Random selection from Crystal

Place the following formula (@random} in your detail section:


Then use {@random} to sort your report ascending.

Finally, go to format->section->details->suppress and enter:

recordnumber > 10000


RE: Random selection from Crystal

Thanks LB for your help but I'm sorry - I don't follow it all.
I've gone into the select expert and the chosen "show formula" and then "formula editor".
My formula at the moment is as follows:
{CBBSECPF.BSBSDS} = "Residential" and
{CBCONHPF.THOWTY} <> 3.00 and

Where do I put the {@random} command?

I understand your second instruction about format, section, details and suppress.

Finally, where do I enter: recordnumber > 10000?

Thanks in advance


RE: Random selection from Crystal

You do not do this in the select statement.

1-Create a formula using the random function by going to insert->formula field->new->name it "random" and enter:


2-Place the formula {@random} on the report in the details section.  

3-Then go to report->sort records and add {@random} as the sort field.

4-Then go to format->section->details->suppress (you don't need to check it)->x+2 button to the right (this is the formula area for section suppression) and enter:

recordnumber > 10000


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close