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

randomly gives 10% of records

Status
Not open for further replies.

deeya

MIS
Sep 18, 2006
78
GB
CR 10 oracle db.

Hi All,

Im totally picking your brains and dont know how to go about this....hopefully you guys can help!

What I want to do is randomly select 10% of helpdesk calls within a specified time period. This should not be the first 10% of records the report hits. i.e total = 100 records, result would be approx record 1, 10, 20, 30 etc

I know how to select by date periods etc i.e the basics but I cant think of a way to do the random selection.

Your help is greatly appreciated.
 
if I recall, Ken Hamady has covered this in his Expert Techniques volume II.


Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
You could do it using the rightmost digit of some account number, Right({Your.Acc}), 1) = 8. Or if this wasn't random enough, get a random digit based on the time, say.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Sorry guys another dilema, we have another system running CR v7 and ive just checked the rnd() function is not available in that version.

Any ideas?

Thanks
 
You could conditionally suppress all records except those perfectly divisible by 10, but that would not be truly random.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
thanks dgillz, but does anyone else have any ideas??
 
I've never used version 7, but my earlier suggestion ought to work.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top