Which version of FMP are you using?

Sounds pretty straight forward. My initial thoughts are below.


On Dec 29, 2007, at 8:38 AM, Andrew Kappy wrote:

1. I need to generate 750,000 alpha-numerics, 6 characters long, excluding certain letters. I have no problem generating as many random numbers as I want, using the RANDOM function, but getting down to 6 alpha-numerics without duplicates is the problem. I've generated 1.5 million random numbers and translated them to integers. I've also built a numbered table of included alpha characters. I've tried various calculations to grab 4 numbers from the larger random number and combine them with two of the letters via calculations. The result is way too many duplicates.

I'd make a custom function combining the use of the RND function and the choose function to accomplish this. Build your random string one character at a time. Probably create a global field to insert each newly created random string with a relationship back to your string field. If there is a match throw away the global and get another random string. If there is not a match then create a new record and put the global in. Repeat until you hit your 750,000 count.

Depending on your OS and hardware this process might take a while to accomplish.

2. I need to generate over 10,000 records of 24 fields, with the numbers 1-24 (or letters A-X) randomly distributed through each record, with no repeats within a record and no distribution repeated within the 10,000 records.

Create a calculation field that is the concatanation of your 24 fields then each time you create a new random field entry check to see if it already exists in your calculation field. Check for duplicates of the calculated field and if there are rebuild your 24 fields until you hit 10,000 unique records.

HTH,

Jens

Jens Selvig
...Lost in Montana...

Reply via email to