Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Random records in a report Post Reply Post New Topic
Author Message
achandana01
Groupie
Groupie
Avatar

Joined: 20 Jul 2011
Online Status: Offline
Posts: 59
Quote achandana01 Replybullet Topic: Random records in a report
    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
IP IP Logged
adavis
Senior Member
Senior Member


Joined: 30 Oct 2012
Online Status: Offline
Posts: 104
Quote adavis Replybullet 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
IP IP Logged
achandana01
Groupie
Groupie
Avatar

Joined: 20 Jul 2011
Online Status: Offline
Posts: 59
Quote achandana01 Replybullet 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
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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
 
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.