Print Page | Close Window

Random records in a report

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=20874
Printed Date: 07 May 2024 at 1:47am


Topic: Random records in a report
Posted By: achandana01
Subject: Random records in a report
Date Posted: 09 Jul 2014 at 4:55am
Hello,

I have a data something like below however I would like to select 20 random ICD9 codes and 15 random ICD10 codes in my report. Here is the data looks like

Patient ID Code type     Code
100         ICD9     V320
100         ICD10     E321
100         ICD9     V322
100         ICD9     V323
200         ICD9     V324
200         ICD10     E325
300         ICD9     V326
300         ICD9     V327
300         ICD9     V328
300         ICD9     V329
400         ICD10     E330

All I am looking for is 20 random patients for ICD9 code type and 15 random patients for ICD10 codes it will be great if all 35 patients are distinct.

Any help will be greatly appreciated.

Thanks.


-------------
chand



Replies:
Posted By: adavis
Date Posted: 10 Jul 2014 at 3:19am
I have never used it, but there is a function to randomly sample

rnd()

There is another post that explains it http://www.crystalreportsbook.com/Forum/forum_posts.asp?TID=5739


Posted By: achandana01
Date Posted: 10 Jul 2014 at 9:01am

This might work however i need random records for specific code type ICD9/ICD10 that is where I am struck at.

-------------
chand


Posted By: DBlank
Date Posted: 10 Jul 2014 at 10:13am
group on the code type
set the randomization per the other post
set the RT to reset on change of group
use a conditional suppression of >10 or >15 using the COde type as the other condition for that
 



Print Page | Close Window