khank Posted August 16, 2010 Posted August 16, 2010 What is a simple clean way to calculate if a "record" has a double number? i.e. the number is 533, so there's 2 three's. I have a separate field titled "doubles". I want Filemaker to automate the calculate to see what the double numbers are (example: 33) so on and so forth. As you know there are 10 numbers (range from 0 to 9). Or is there a way?
Vaughan Posted August 16, 2010 Posted August 16, 2010 Since there are only 10 possible double values you could do a brute force method and check if the field has 00 or 11 or 22 or 33 ... or 99. What do you want to do if the field has a double value? What if it has more than one double in it? What should the calculation return if the field contains: 123456 = ? 112345 = ? 112256 = ? 112233 = ?
comment Posted August 16, 2010 Posted August 16, 2010 If you define "double" as two consecutive identical digits and "number" as integer between 0 and 999 (inclusive), then = Let ([ ba = Mod ( number ; 100 ) ; cb = Mod ( Div ( number ; 10 ) ; 100 ) ] ; not Mod ( ba ; 11 ) + not Mod ( cb ; 11 ) ) will return 0 for no doubles, 1 for a single double and 2 for two doubles (jackpot). This can be extended for larger numbers (a custom recursive function could handle numbers of any magnitude).
khank Posted August 16, 2010 Author Posted August 16, 2010 Questions: What do you want to do if the field has a double value? What if it has more than one double in it? What should the calculation return if the field contains: If the "drawn_number" field has a double value there two things I would like to see in the "doubles" field - 1) What was the double value (00, 11, 12 etc.). 2) Eventually count up how many doubles have hit throughout the entire sampling. There can only be one double in a drawn number. If the drawn number is a triple number (i.e. 333) I dismiss it, to me its a number with a double number in it. The calculation is what that double number is, example: 661 was drawn 10/9/2007, in the "doubles" field I would like to show "66". I've attached a screenshot JPG of what I'm doing. Maybe there's an easier way? Sorry for my ignorance, I'm just starting out learning Filemaker. (So far its been a great learning experience.)
comment Posted August 16, 2010 Posted August 16, 2010 You haven't answered the question about 353 - with is another way of asking if the order of the balls matters.
khank Posted August 16, 2010 Author Posted August 16, 2010 See my response to Vaughan - I've attached a JPG of the db file for your reference. The drawn number on 10/9/2007 was 661 so in the "doubles" field I would like to see "66". Today I will start playing around with that code you offered.
khank Posted August 16, 2010 Author Posted August 16, 2010 To me it does not matter how the double number hits, only that a double number appeared (example: 335, 353, 533) in that particular drawing.
comment Posted August 16, 2010 Posted August 16, 2010 Well, then how about = Case ( Ball1 = Ball2 ; Ball1 & Ball2 ; Ball2 = Ball3 ; Ball2 & Ball3 ; Ball1 = Ball3 ; Ball1 & Ball3 ) The result type must be Text in order to accommodate "00".
khank Posted August 16, 2010 Author Posted August 16, 2010 consultant: Thank you the "Case" code works exactly how I wanted it, just now I have to through the entire db individually and update. Filemaker "formulas/coding" seem simple compared to Excel and its formula's - just practice, practice, practice. Again thanks for your help.
Raybaudi Posted August 16, 2010 Posted August 16, 2010 This is my try: Filter ( ball1 & ball2 & ball3 ; Filter ( ball1 ; ball2 ) & Filter ( ball2 ; ball3 ) & Filter ( ball3 ; ball1 ) ) Note that it takes in account double and triple numbers.
comment Posted August 16, 2010 Posted August 16, 2010 now I have to through the entire db individually and update. Huh? Why don't you make it a Calculation field?
khank Posted August 16, 2010 Author Posted August 16, 2010 I did make a calculation field after the fact. I started by inserting my Excel document. I didn't setup my fields just individual tables "Midday" and "Evening". I know just dumb. It gave me the necessary date, ball1, ball2 and ball3. But not the concatenate number (drawn_number), doubles or root. I had to insert manually. Now it looks like I have to go back and start fresh with a new database setup. Why? It just dawned on me that I could use the same layout for both the "Midday" and "Evening" game instead of setting up two individual tables and field names. I'm thinking since I'll have "all" the fields and calculations pre-set all I'll need to do is to setup a new "Midday" and "Evening" tables - and just import only the date and the individual ball numbers onto that layout, I'm hoping it should automatically input the "doubles" and the "root".
khank Posted August 16, 2010 Author Posted August 16, 2010 ChindoguMaker: Your English is fine. What "consultant" recommended works great. Over the years working on a lowing the odds on a "game-of-chance" you great fairly insane. So I try to keep everything as simple as possible. The Michigan Pick 3 lottery game is a "ball-drop" game with 3 separate bins with ping-pong balls ranging from 0-9 spinning around in each bin. Giving you 1000 numbers ranging from 000-999 to choose the winning number from, some folks look at the triples (111), but I don't, I feel why should I deal with only 10 numbers (hitting usually 1 to 3 times per year) when doubles represent a high percentage of numbers hitting on an average of 3 times per week. Thank you for the input...
comment Posted August 16, 2010 Posted August 16, 2010 working on a lowing the odds on a "game-of-chance" LOL, good luck with that. The only way of improving your odds is to prove the game is rigged.
Raybaudi Posted August 16, 2010 Posted August 16, 2010 ... when doubles represent a high percentage of numbers hitting on an average of 3 times per week. I'm curious ... you have double numbers come out in a year. Do you play the most frequent or the least frequent ?
khank Posted August 17, 2010 Author Posted August 17, 2010 ChindoguMaker: Don't waste your time on frequencies they won't work. I've spend a ton of time over many years going down bright alley's only to come up short until I discovered a way to range my numbers, thus cutting down 1000 numbers to only 60 – 70 daily numbers of those numbers are 12 – 18 doubles. Speaking about "doubles". In the Michigan Pick 3 Midday game for 1047 drawings there has been 323 (31%) doubles that hit. For the Evening game for 1047 drawings there has been 283 (27%) doubles that hit. Don't let those low double numbers and percentages fool you. Midday doubles hit on a solid average of 2-4 times per weekly cycle, and that has happened in 76% of the weeks. But the evening doubles are hit on the same 2-4 times per weekly cycle at a solid 81% of the weeks. Remember no one can predict what the exact number will be tomorrow.
Raybaudi Posted August 17, 2010 Posted August 17, 2010 This is exactly the reason because I asked you about frequency ... So why you are going to make such type of statistics ? At the end you'll find that there isn't a simple way to win and that no calculation can cutting down 1000 numbers: they are always 1000 each drawing.
khank Posted August 17, 2010 Author Posted August 17, 2010 Why these type of statistics? I ask myself everyday the same question. For me they are strictly "free-floating" reference points in an equation I apply daily to get the likelihood of a double hitting – its not a "sure" fire way to predict but it has a extremely high degree of success. You are absolutely right - there isn't a "simple" way to win anything and there is no calculation which will cut down 1000 numbers to just ONE winning number. That's why they call it a "game-of-chance". For me it’s a great way to keep my mind sharp and a great hobby, plus I make a little money every week – tax-free. Badda Bing, Badda Boom
Vaughan Posted August 17, 2010 Posted August 17, 2010 The difference between investing and gambling is that investment losses are tax deductible. :)
khank Posted August 18, 2010 Author Posted August 18, 2010 See sample: I'm trying to get the "latest" record (4) to see if the "prior" record (3) has a matching number and return a Yes/No answer in the "match" field. In Excel it is a "IF" formula to resolve. I'm thinking this is some sort of a "CASE" calculation? I'm not concerned which "Field" the number came from just that there's a match or not (Yes/No). Occasionally there could be all three numbers matching, just keeping it simple, just to see if there's a number match or not from the prior game to the latest number. Thanks ahead of time,
Lee Smith Posted August 18, 2010 Posted August 18, 2010 Is this a followup post to your other question?
khank Posted August 18, 2010 Author Posted August 18, 2010 Yes it is. I've been scouring the Internet for samples on how to write this function and came up empty. I don't believe it should be that difficult.
Lee Smith Posted August 18, 2010 Posted August 18, 2010 I've merged your topics. Please do multiple post your question. It is not necessary to start a new Thread when asking followup questions. Just Reply to the existing thread with your new information and/or questions. Anyway, keeping everything in one place, will not only make it easier to follow your quest for a solution (the members can refer back to what has been asked and suggested), it will save us time by not having to jump between threads. IMO you have had some of the best experts we have helping you. So, maybe it isn't as simple as you thought. Lee
LaRetta Posted August 18, 2010 Posted August 18, 2010 (edited) I need to know what you want to do with this information. Is it just for display, for use in calculations, for export, what? Oh, and does it ever go into double numbers or greater? Edited August 18, 2010 by Guest
LaRetta Posted August 19, 2010 Posted August 19, 2010 I may be misunderstanding your need. But if you only want to check the immediate prior value (and by your example that's what you want) then you can try this (I colored to show the matches but the word 'yes' calculation is automatic) MatchAny.zip
khank Posted August 19, 2010 Author Posted August 19, 2010 This information will be use for summary page calculations, such as "How many times a number hit from the prior game". For display? Only an additional column was added on the very first example above. Export I don't believe so (why?). Yes, there will be double numbers, once in while all three will appear. Remember I'm not concerned about "numbers" as much as I'm concerned about did or not a number appear from the prior drawing and appear in the current game, then get a Yes/No answer in the "match" field. As I have mentioned above, I'm trying to learn Filemaker Pro, along with another set of parameters and terminology of the program. I've let to get my head around this program's functions and calculations, I'm still thinking like it is Excel. FYI if you look at the first example way above I have now added a auto-fill" "record_ID" starting at 1 to identify the record. Again another "throw-back" to Excel (column and row numbers).
LaRetta Posted August 19, 2010 Posted August 19, 2010 (edited) "Export I don't believe so (why?). " I have not followed this long thread (and have no intention to; I just don't have the time right now). You presented a picture and asked a simple question so I answered it. I asked what you are doing with this information - a logical question and one to which, without an answer, a response can't be properly given. I have given you a file to work with. I suggest you sit down with a whiteboard and draw out the logic of it. If you can do it on paper, you PROBABLY can do it in FileMaker. But I recall glancing as some questions such as ... 333 is that considered a match to 33 and so forth. The issue here is 1) you need to get the logic clear on the rules and 2) you need to play with FileMaker to determine what you want. I suspect your structure isn't ideal for what you are trying to do. But, as Lee states, you've had some of the best minds reading up on this, so stop it with the 'it should be simple' remarks because if it was, you would have found many hits when you googled and the great people here would have handed you an answer quickly. Be thankful for the assistance you are receiving. Good night. BTW, the serial incrementing record ID isn't an Excel 'thing' ... it is standard practice in the database world which goes way back before Excel was even a twinkle in Bill's eye and is known as a primary key. Edited August 19, 2010 by Guest Added update
khank Posted August 19, 2010 Author Posted August 19, 2010 LaRetta; It sounds that I have somehow upset or offended you and Lee, if that is the case please except my apology, it was not my intent to make light of the complexity of Filemaker or having a flippant attitude. And God knows after googling and reading the supplied manual, and getting more confused as days wear on what a breathe of "fresh-air" coming to this forum and getting concise answers, even for a beginner like me can understand. And thank you and the talented people on this site for the opportunity to learn "hands-on" from some of the very best and brightest in the business and throughout the world. Thank you!
Raybaudi Posted August 19, 2010 Posted August 19, 2010 I'm not concerned about "numbers" as much as I'm concerned about did or not a number appear from the prior drawing and appear in the current game, then get a Yes/No answer in the "match" field. The LaRetta's example does exactly what you want. I made some modifications on her file only to add conditional fills. ( if there is a match with a previous record, the fill of the matching field will be green while the fill of the field in the previous record will be orange [ or green if it's previous record has another match ] ) So each record with a "Yes" into the "match" field contains at least a green field. MatchAnyMod.zip
khank Posted August 19, 2010 Author Posted August 19, 2010 ChindoguMaker; Thank you. I took a quick glance and yes. I'll take the time to study the in's and out's of this and LaRetta's to get somewhat of a "handle" on the interaction of the relationships, tables, fields and indexing. I know I'll be back with more questions on this piece of the pie. Again thanks to the both of you.
khank Posted August 22, 2010 Author Posted August 22, 2010 I followed the "MatchAnyMod" example, that works exactly how I want it too. In my file its not happening and I can't figure out where I messed up? It highlighting only 0's and 2's, the "match" (Yes/No) is wrong, and it's highlighting numbers it shouldn't. Whatever I've done it consistent. I've checked and rechecked. Can I get an explanation why this is happening. Zipped are both files (the example and my file). Sample.zip
khank Posted August 23, 2010 Author Posted August 23, 2010 I got the "yellow" (representing prior numbers working). I still haven't gotten the "green" working (representing current drawing – its still just highlighting 0's and 2's). Nor is the "match" correct. I've checked my sorts and relationships everything appears to be correct. Still its not working like the sample. What am I missing? Maybe I just cannot see the forest for trees, I don't know.
Recommended Posts
This topic is 5260 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 accountSign in
Already have an account? Sign in here.
Sign In Now