Hi Support,
Could you please tell me the context for using the RANDOM function.
I tried Gift.VoucherNumber = RANDOM as a rule but I keep on getting error messages.
I also tried a rule Gift.C= RANDOM(VoucherNumber)
This gives me the following error in testing mode
Operation error. com.bas.shared.ruleparser.ParseException Unsupported function RANDOM
Thanks
Alan
RANDOM Function
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
What is the format of the Gift.VoucherNumber attribute?
The default format (#) corresponds to integer - this could be the reason why you always getting zero, since RANDOM returns a double value in the range 0 - 1. For example, 0.124342. So the result is then rounded to the nearest integer which is zero.
So you need to either set the format of the attribute to be double (for example, #.##) or multiply the result by some factor.
The default format (#) corresponds to integer - this could be the reason why you always getting zero, since RANDOM returns a double value in the range 0 - 1. For example, 0.124342. So the result is then rounded to the nearest integer which is zero.
So you need to either set the format of the attribute to be double (for example, #.##) or multiply the result by some factor.
Aware IM Support Team
I noticed that the documentation is still wrong for the RANDOM function. I had to search the forum because I ran into the same exact problems as joftech.
It would be helpful if the text in the rule editor would display that the brackets () are required for the function to work (or have them automatically display when the RANDOM function is selected) and that the attribute should be a double.
It would be helpful if the text in the rule editor would display that the brackets () are required for the function to work (or have them automatically display when the RANDOM function is selected) and that the attribute should be a double.