Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 5384 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I am trying to set a field to pull a random number each time a record is created. I have a field named "Dice" with a calculation

"1" - "100" * Random

And a field named "randam_number" with the calculation

Middle (Dice; Position (Dice; "-"; 1; 1) + 1; Position (Dice; "."; 1; 1)-2)

At first this seams to work just fine. I get numbers like 59, 18, 89 or 7. Buy every once in a wile I get a blank field. Any ideas.

Posted

Well,

"1" - "100" * Random

returns a number between 0 and -98.9̅9̅9̅9̅9̅

Then, your calculation returns blank whenever Dice is between 0 and -.9̅9̅9̅9̅9̅ and also when Dice is an integer - roughly, in 1% of the cases.

Why not use simply:

Int ( Random * 99 ) + 1

This topic is 5384 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.