Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to generate random numbers in MSTR

Metrics

How to generate random numbers in MSTR

by  510diva  Posted    (Edited  )
This function returns a random value between two arguments. The syntax is:
Randbetween(x, y)


[M1] = Sum([Unit Cost]){~+}
[M2] = Randbetween([M1] * 0, 1)


The metric [M1] is needed because the [randbetween] function needs to have a dimensionality, and it is provided by [M1]. [M2] will produce a uniform random number between 0 and 1 for each row.
IMPORTANT: When this approach is used to generate random numbers, a risk of an overflow in the MicroStrategy Intelligence Server's memory is present when large amounts of data are retrieved. This happens since all the data needs to be brought to the MicroStrategy Intelligence Server to perform the calculation.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top