Newbies soleilx Posted February 22, 2008 Newbies Posted February 22, 2008 Hello everyone Here's the challenge, I need to be able to add numbers together within a field i.e. "27" = 9 or "11.2 11.7" = 4.9 basically reducing the value to it's simplest number. I'm not that well versed in math calculations or formula's but there must be a way to do this in FM?! FYI, This will be used in a Lab for determining patient results, but there will be many values (that need this calc done on them or the whole thing is a bust) within a table. Thank you Arthur
Colin Keefe Posted February 22, 2008 Posted February 22, 2008 If you don't mind typing in operators, e.g. "2+7" and "11.2+11.7", then you should explore how the Evaluate[] function works. Look in FileMaker Help. If operators need to be implied, then you'll want a Substitute[] function as well, e.g. Evaluate( Substitute(myfield;" ";"+") ) The first is obviously more flexible since the user can type in any mathematical formula.
comment Posted February 22, 2008 Posted February 22, 2008 Well, 2+7 returns 9, but 11.2+11.7 returns 22.9, not 4.9 as indicated. I don't know what "reducing the value to it's simplest number" means. Perhaps it's just summing all the digits, unless there's a decimal point - that's the only way I can see of getting 4.9 from "11.2 11.7". But I cannot imagine how this would be useful in any context, and I am concerned for the well-being of the patients using this lab.
David Jondreau Posted February 22, 2008 Posted February 22, 2008 He must mean summing the values 1, 1.2, 1, 1.7 and summing the values 2, 7.
Colin Keefe Posted February 22, 2008 Posted February 22, 2008 Well, it does add up that way. I have to say the logic is a little obscure. How the heck do you differentiate between "11.2" as a number versus "11.2" representing a statement to evaluate (1 + 1.2)? Only the poster knows.
Colin Keefe Posted February 22, 2008 Posted February 22, 2008 Actually, Michael knows too. Sorry, just read your post a little more closely. Still don't understand why.
David Jondreau Posted February 22, 2008 Posted February 22, 2008 Maybe because the OP isn't paying that much attention to the spacebar when posting? Who knows? And does it really matter? Either your first comprehensive answer will suffice or he'll clarify the logic.
Colin Keefe Posted February 22, 2008 Posted February 22, 2008 Maybe because the OP isn't paying that much attention to the spacebar when posting? Who knows? And does it really matter? Either your first comprehensive answer will suffice or he'll clarify the logic. It doesn't matter at all. I just worry and nibble at things long after they cease to be important. It's a personal failing.
_henry_ Posted February 22, 2008 Posted February 22, 2008 Hi Arthur, i.e. "27" = 9 or "11.2 11.7" = 4.9 Can you give more information about this? I assumed the first one is "2+7=9" and the second one may come from "1+1+1+1 . 2+7 = 4.9"? Is that right? :qwery:
Newbies soleilx Posted February 23, 2008 Author Newbies Posted February 23, 2008 Hello Henry Yes to the way you added things up. the numbers represent seconds (time value) they are response times of the patients. However inorder to use them they must be reduced. another example. 64 6+4would equal 10. just as 2008 would 2+0+0+8=10. these time results are then used with other variables at the end to make sense of the data collected. I am very appreciative for all the responses WOW. if this is not clear enough I will attempt another example. Most of the other variables are simple addition, division or averaging. between other sets of numbers. The weird thing here is doing it within the field (1111) or a set of field (111) + (222)+(333)= 18. thanx again Arthur
comment Posted February 23, 2008 Posted February 23, 2008 Let me make a suggestion: get whoever inputs the data to input it correctly. It seems that in this case correctly means a new record for each entry. That's where the real problem is, IMHO.
Raybaudi Posted February 23, 2008 Posted February 23, 2008 He must mean summing the values 1, 1.2, 1, 1.7 and summing the values 2, 7. ... or redux first number & "." & redux second number like: 11.2 -> 4 11.7 -> 9 so 4.9 ... or redux Int ( first number ) + redux Int ( second number ) like: 11.2 -> 2.2 11.7 -> 2.7 so 2.2 + 2.7 = 4.9
Raybaudi Posted February 23, 2008 Posted February 23, 2008 This calculation seems to solve all your examples: Case( Mod ( field ; 9 ) > 1 ; Mod ( field ; 9 ); Mod ( field ; 9 ) + 9 )
LaRetta Posted February 23, 2008 Posted February 23, 2008 (edited) So there will never be a single number greater than 9? I agree with Comment ... this is very funky way of handling it. And what if the User puts a[color:green]n extra space or some other character? Update: Added the green for clarity Edited February 23, 2008 by Guest
LaRetta Posted February 23, 2008 Posted February 23, 2008 (edited) Wow, not only that but the logic is totally whacky. 11.2 11.7" = 4.9 And what if it is 11.99 11.9? It should equal 4.108? Does it ever round? Is it a decimal or some meaningless second number? Danielle, your last calculation seems to produce strange results on the example 11.2 11.2. I get 2.2112. None of this makes any sense to me at all. Sorry. :crazy2: Edited February 23, 2008 by Guest Fixed typo in calc example
Colin Keefe Posted February 23, 2008 Posted February 23, 2008 the numbers represent seconds (time value) they are response times of the patients. However inorder to use them they must be reduced. Why must they be reduced to this shorthand notation? Is this some kind of standardized shorthand notation used in your industry? Or is it some clever idea someone came up with in your department? If it's standardized, can you point us to the standard? I'm curious, and looking at the actual standards document would probably clarify.
Recommended Posts
This topic is 6178 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