How do I populate a field with a series of random numbers?

To populate a numeric field (i.e. Float, Decimal or Integer type) with random numbers (e.g. values between 0 and 100), use the Table> Update Column tool (ensure that the table is editable i.e. in a native MapInfo format)).

Set the target table in the Table to Update area, and the target field in the Column to Update area.

In the Value area, enter rnd(1) - this will generate a decimal fraction (i.e. values between 0 and 1).

This can be modified to create more specific ranges:

    rnd(1) * 100           - creates values between 0 and 100
    rnd(1) * 10 +10      - creates values between 10 and 20


Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Remove Highlighting Remove Highlighting

Edit this article

User Opinions (2 votes)

100% thumbs up 0% thumbs down

How would you rate this article?




Thank you for rating this article.

Related Articles

No related articles were found.

Attachments

No attachments were found.

Last Updated on: 23rd of April, 2008