Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Random Number Group Post Reply Post New Topic
Author Message
wsc27
Newbie
Newbie


Joined: 25 Jun 2012
Online Status: Offline
Posts: 10
Quote wsc27 Replybullet Topic: Random Number Group
    Posted: 15 Mar 2021 at 8:37am
I am using the rnd() formula to assign random # based on a field at the group level. The field can have multiple detail lines. My report setup currently is only pulling if the random # assigned appears once instead of all of the detail lines for the random # for the field at the group level.

I would like for report be like example below…….
Example: Audit User 1 – Random# 100
Details for Random User #100
Details for Random User #100
Details for Random User #100

But Crystal is doing this instead
Example: Audit User 1 - Random# 100
Details for Random User #100
(Leaving out the other detail lines for the group)

Seems like even though random is at the group level, the report only uses one random# at the detail level instead of multiple details per grouped random#. Please assist.

Thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Mar 2021 at 10:16am
Are you trying to get the report to randomly select a user based on their ID?
IP IP Logged
wsc27
Newbie
Newbie


Joined: 25 Jun 2012
Online Status: Offline
Posts: 10
Quote wsc27 Replybullet Posted: 15 Mar 2021 at 10:27am
@DBlank Yes, I am then display all of the multiple detail lines for that one or multiple randomly selected users.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Mar 2021 at 10:37am
I don't think this will work that way for you.If possible can you do the random selection process in your select statement or stored procedure? I think maybe you could group on the staff ID and use the rnd() value i the group header and sort by the rnd formula field adn you the top 1 group select. but you would need to select your entire data set to when running the report.
IP IP Logged
wsc27
Newbie
Newbie


Joined: 25 Jun 2012
Online Status: Offline
Posts: 10
Quote wsc27 Replybullet Posted: 17 Mar 2021 at 5:44am
Instead of using an audit report as an example. I am testing the random # at group level with appointments. When I put the random# at the group level for the patient, it's only returning one appointment for each patient instead of all appointments? How can I assign a random # for each patient, but show all appointments? Thank you!
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.047 seconds.