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

help in using rnd function

Status
Not open for further replies.

reacha

Programmer
Jun 9, 2010
83
US
In my report i have group on Username,auditstamp,pkgid

when i group by username under that i may get 5 or 6 dates and after that there is a group by pkgid.

I need to get two random pkgid's for each user with the respective dates


Please help me out its very urgent

Thanks,
reacha
 

Hide the details section, then insert formula {@Random} in the pkg_id group header:

Rnd(1)

Then place a max of that formula in the group footer. Since there will only be one record per group the max would be the same as the min, avg, etc.

Under Report: Group Sort Expert, create a Top N for the group PkgID using the field max of {@Random}. Set N = 2 and uncheck Include Others.

This will give you two random pkg ID's for each of the date groups - not sure if that's exactly what you want, but it should be easy to tweak it from there.





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top