Jump to content

juanito2006

Members
  • Posts

    21
  • Joined

  • Last visited

juanito2006's Achievements

Apprentice

Apprentice (3/14)

  • First Post
  • Collaborator
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. FM is a new program for me. I am a beginner. Could you post a file with an example of what you said please? It is all greek to me at this point.
  2. ALRIGHT!! Big thank you to LaRetta and comment for solving this problem and everyone lese that tried to help. And again my apologies for the really bad explanation. Now for the second part of my problem. I tried to present it in another post but an admin merged it with this one. This is the long version: I have a database with 100 records. Every record has a number field. I want to fill that field with a random number so I use the following calculation: Max ( MINIMUM ; Int ( Random * 499 ) + 1 ) To do that I go to "Define Fields", I highlight the number field, I change the type from number to calculation, I press save, a box that says the following: "When changing the field type to Calculation or Summary, FileMaker will replace any data in the field with the result of the formula. Proceed anyway?" I press "OK" and the "specify calculation" box appears. I enter: Max ( MINIMUM ; Int ( Random * 499 ) + 1 ) and press "OK". That takes me back to the "Define Fields" box. I press "done" and then every record has the number field filled by a random number. BUT what I would like is that when I go to a record and press on the number filled thats when it gets filled AND NOT automatically after pressing "done". Ender replied this in the other post. Can someone clarify this, maybe show me step by step: "It sounds like you just need to populate the random number field with a button click? If so, change your field back to a Number and define a script with a Set Field[] script step having your random calc as the source and your field as the target. Then define a button with a Perform Script, selecting your new script as the script to run. "
  3. I get this error: "either an operator was omitted,this function cannot be found, or "[" was not expected here"
  4. why? It was two different things (even though closely related) and this post is getting so complicated already :
  5. But every record has a different minimum so to arbitrarily assign 200 in 40% of the cases would be no good.
  6. This is what I put in as the calculation: Let(RanNum = 1 + Int ( Random * ( 499 - 1 + 1 ) ); If(RanNum < Minimum ; Minimum ; RanNum) ) I get this error message: "either an operator was omitted,this function cannot be found, or "[" was not expected here" What did I do wrong?
  7. your formula is correct, I just explained myself badly. if a record has a minimum of 200 then with your formula it would calculated between 200 and 499. If I put 1 as low and 499 as high it would calculate in that range. But is there a way to calculate a random number anywhere between 1 and 499 and then if the number is lesser than the minimum change it to be EQUAL to the minimum?
  8. So I would be able to click record by record and only fill those I want? Could you please show me how? I do appreciate your patience. I have explained myself pretty badly and my FM knowledge is extremely limited.
  9. I think the problem is that using this formula: LOW + Int ( Random * ( HIGH - LOW + 1 ) ) the random number is calculated between high (499) and the minimum. This formula on the other hand: Int((Random * 499) + 1) calculates the random number between 1 and 499 That's why I get high random numbers for records with high minimums. I probably explained myself badly, but what I need is for the random number to be calculated between 1 and 499. Now lets say a record with a minimum of 200 gets 100. That then needs to be corrected so it gets 200
  10. this is so strange. Let's try another way maybe. Let's say I put my calculation in without worrying about minimums Int((Random * 499) + 1) all records get a random number. I then tranform this field back into a number field. Is there a calculation that I can then put in the random number field so that the random number in each record is equal to its minimum if it was of lesser value?
  11. In your example it works. Any way to do that test with different low numbers for each record? It should work in my database. Any reasons why it wouldn't?
  12. I have tried this formula 20 times: LOW + Int ( Random * ( HIGH - LOW + 1 ) ) The "random numbers" I get are high for records with high minimums and get progressively smaller on records with lower minimums. I tried this formula another 20 times: Int((Random * 499) + 1) The "random numbers" I get are evenly given. There are record with high minimums that have a high random number, there are records with high minimums that have a low random number, there are records with a low minimum that have a high random number and thereare records with a low minimum that get a low random number. So the first formula is not truly random, the second is, but the seconds does not acheive what I want. Is there any other calculations that would work? And what is this script thing. I am not familiar with scrpits. Any chance of step by step help please?
  13. I apologise, I should have given details. I use the formula given to me by comment: LOW + Int ( Random * ( HIGH - LOW + 1 ) ) Low being the minimun number and high being 499. The problem is not the range. It does give me a number between the minimum and 499. The problemis that records with high minimum numbers get a high random number. Those with low minimum numbers get lower random numbers. It defeats the purpose of getting a random number
  14. I have posted about this problem before because I posted two questions at the same time it became confusing. Let me try and explain this step by step: I have a database with 100 records. Every record has a number field. I want to fill that field with a random number so I use the following calculation: Int((Random * 499) + 1) To do that I go to "Define Fields", I highlight the number field, I change the type from number to calculation, I press save, a box that says the following: "When changing the field type to Calculation or Summary, FileMaker will replace any data in the field with the result of the formula. Proceed anyway?" I press "OK" and the "specify calculation" box appears. I enter: Int((Random * 499) + 1) and press "OK". That takes me back to the "Define Fields" box. I press "done" and then every record has the number field filled by a random number. BUT what I would like is that when I go to a record and press on the number filled thats when it gets filled AND NOT automatically after pressing "done". Am I making any sense? I hope someone can help. Thank you.
×
×
  • Create New...

Important Information

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