Jump to content

Need unique random number within a range Help


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

Recommended Posts

Hello

I need to make a formula that gives us a unique number with a range. The fields are

"lownumber" highnumber" and "RANDOMNUMBER" SO if the low number is 001 and the high number is 999 it needs to pick a random number that hasn't been used ,

I was thinking of adding a field called "USEDNUMBERS" and wondered if somehow it could probe that field and choose. I need help with this one.

Thanks

Stan

Link to comment
Share on other sites

I don't think it can be done with just a calculation. This is a little file I made, for my local Mac user group, to do raffles. It can do more than one at once, because they may be giving tickets out from different rolls with discontinous numbers.

You just need the basic Pick New Number Only script. The others are for the discontinous rolls.

RafflesSer.zip

Link to comment
Share on other sites

Thanks so much, That is what I need to get mine to work. But I am not quite clear if it probes the field to search it to see it the number already exists so as not to duplicate it.

I can't duplicate the numbers because this is for making a badge for each person so they have a unique number at every event on a badge they wear. It is important that I get a unique number.

thanks

Stan

Link to comment
Share on other sites

That's what the "not PatternCount()" clause is doing, seeing if the "new" number produced by the Random function exists already in the multi-line global field holding the already picked numbers.

If you want to keep those already picked numbers over a period of time, or do this on a network, you should change that field to a regular text field.

Link to comment
Share on other sites

This topic is 7345 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.