Random

<< Click to Display Table of Contents >>

Navigation:  Reference > Transforms >

Random

Description

Adds a new column, filled with pseudo-random values.

 

Examples

Add a new column of random real values between -1 and +1:

 

pseudo-random number generator

 

Add a new column of dates randomly chosen from 1st Jan 2000 and 10th June 2025 (inclusive):

 

pseudo-random date generator

 

Add a new column of text values randomly chosen from 'A', 'B' or empty:

 

pseudo-random text generator

 

Inputs

One.

 

Options

Set New column name to the name of the new column you want to create.

Set Type depending on whether you wish to generate Real (floating point), Integer (whole number), Date or Text values.

Set Seed to the seed value used by the pseudo-random generator algorithm.

Set Minimum to the minimum value you want to generate. The value may be equal to minimum, but not less. For Type is Real, Integer or Date only.

Set Maximum to the maximum value you want to generate. The value may be equal to maximum, but not more. For Type is Real, Integer or Date only.

Set Format to the date format. For Type is Date only.

Set Values to a comma delimited list of values to choose from. Empty and duplicate values are allowed. Values may not contain commas. For Type is Text only.

 

Notes

The values output are a sequence of pseudo-random values based on the Seed value.

The same sequence is always output for the same options.

The default Seed value is based on the system clock when the transform was first created.

If Type is set to Text, you need to provide a

As an alternative to setting Type to Text, you can use Random with Type set to Integer and then use the results in conjunction with Lookup to lookup text values using an integer key.  

To generate random dates or datetimes then use Random with Type set to Integer and then use the results in conjunction with Calculate with Operation set to MSecsToDateTime.

To generate passwords use Random in conjunction with the Hash transform.

New columns are always added at the right end. You can change the column order with Reorder Cols.

You can use the Correlate transform to check sets of random numbers are not correlated. This show the very low correlation between 2 sets of 1,000,000 values between 0.0 and 1.0 generated by Random using seeds 0 and 1:

 

correlating pseudo random numbers

 

See also

Sample

UUID