Jump to content

35 random non-repeating records


rivet

This topic is 6603 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Start by adding a number field Position. Use replace to fill it will a serial number. In a script make a loop that starts with the first position, gets a random number between 1 and the number of records. Exchange position numbers between these records. Go to position 2 and repeat the above. Continue until you have exchanged the last position. Sort by position. Use the first 35.

You can repeat the process several times to get more changes to the order.

Link to comment
Share on other sites

they need to be names pulled from a table of names.

Thinking about it now, I am going to try a script that will loop, do a find on a number in the 'found count' if that record has been tagged, skip, else tag.

Link to comment
Share on other sites

Take a look at the sample file that does what I had suggested earlier. It has 2 scripts one which will set the order number in sequence, the other which will randomize it. You can repeat the second several times to get more mixing. Sort of like shuffling a deck of cards.

Link to comment
Share on other sites

Ralph, I can't read your attachment cos it's .sit but rivet is after a card hand, not a shuffled deck.

Rivet, If your table of names is in a table separate from your selected subset, then

1. Number your names (auto serial will do) Say N names.

2. Select a random number between 1 and N

3. Copy that name and serial into your table

4. (3.5) Define a self-join on serial

5. If Count(SelfJoin::serial) > 1 delete it and get another one.

Link to comment
Share on other sites

You need a copy of Stuffit expander for Windows, it used to be free, I haven't checked recently. Works with all sorts of compressions. You shuffle the cards before you deal the hand. I can send you a .zip if you are interested.

Link to comment
Share on other sites

Ralph,

Thanks. I'll check out the Windoze version. (No need to waste your time on my abysmal ignorance.)

I just love the way so many of these posts descend into arguments/discussions/duels/.. about what the original poster was looking for. The really beaut thing is that rarely does the OP join in!

This time he has and I'm going to have a look when I sober up in a minute or two.

(It's real time here - about 00.07) Blackstuff.gif

Link to comment
Share on other sites

Rivet,

Sorry to be so long. A network break and a paying job intervened.

I like your solution. Neat. Why did you add 1 to the FoundCount? You do not need to cater for the extremes of Random (0 and 1). Go to Record [Value] takes you to record 1 or the last record, if the Value is outside the valid range.

You do realise that your set is not, mathematically speaking, truly random?

Link to comment
Share on other sites

The way radom numbers are generated is not truly random. Each number in the series is dependent on a seed number. The seed may be generated from the date, the time, the computer's id, and even the preceeding random number. I don't think you have anything to worry about.

Link to comment
Share on other sites

This topic is 6603 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.