Oracle® OLAP DML Reference 11g Release 2 (11.2) Part Number E17122-07 |
|
|
PDF · Mobi · ePub |
The RANDOM function produces a number that is randomly distributed between specified low and high boundaries. Randomly generated numbers are useful when building and duplicating tests of applications. They are especially useful for simulation and forecasting applications.
Tip:
To compute the number, RANDOM uses the values of the RANDOM.SEED.1 and RANDOM.SEED.2 options and then changes the values for the next time. When you create your own seeds, set the value of both options to odd numbers. This practice enhances the randomness of the numbers that are produced.DECIMAL
RANDOM([lowbound] [highbound])
A numeric expression that specifies the lower boundary for the random number series. The default is 0
. When lowbound is NA
, the RANDOM function produces NA
.
A numeric expression that specifies the upper boundary for the random number series. The default is 1
. When highbound is NA
, the RANDOM function produces NA
Example 8-64 Producing Random Numbers
This example assigns random numbers between 100 and 200 to a variable called test
, which is dimensioned by product
.
test = RANDOM(100 200) REPORT test
These statements produce a report such as the following.
PRODUCT TEST -------------- ---------- Tents 122.93 Canoes 176.69 Racquets 168.32 Sportswear 150.92 Footwear 187.46