Newbies adydas Posted July 27, 2003 Newbies Posted July 27, 2003 I am having trouble writing this if statement. dont know the correct syntax in filemaker when balance is 50,000 i get nothing as result If(balance ? 2500, "a","") or If(balance ? 5000, "b","") or If(balance ? 50000, "e","")
EddyB Posted July 27, 2003 Posted July 27, 2003 Hi, here is the syntax to use... If (balance = 2500, "a" , If (balance = 5000, "b" , If (balance = 50000, "e" , ""))) Ed.
danjacoby Posted July 27, 2003 Posted July 27, 2003 For this example, you really should use the "Case" function.
Lee Smith Posted July 27, 2003 Posted July 27, 2003 I agree with Dan, I find the case statement a lot easier to write. Case(balance = 2500, "a", balance = 5000, "b", balance = 50000, "e" ) Lee
EddyB Posted July 27, 2003 Posted July 27, 2003 I do agree, the case statement would be best. Adydas, if you do want to use the IF statement then use my example above, but as the other 2 posts say you should always favour the case function over the If statement, it has been proved to be the quicker option. The difference between the two is, the IF function will check every statement even once it has found something to be true. The Case statement stops once it finds the statement which is true. Ed
Helpful Harry Posted July 28, 2003 Posted July 28, 2003 One possible problem here: the original question has "?" in the formula (at least on my screen). Now if these "?" are really 'less than or equal' symbols or just 'equal' symbols then Lee Smith's Case function above is fine, but if they're really 'greater than or equal' symbols then you need to turn the Case function upside down. Case(balance >= 50000, "e", balance >= 5000, "b", balance >= 2500, "a", ) otherwise you would always get "a" (unless balance < 2500), even when balance = 70000 since 70000 > 2500 is correct.
Newbies adydas Posted July 28, 2003 Author Newbies Posted July 28, 2003 Thanx guys. This is what I used Case(balance > 1 and balance< 2500, "a", balance > 2500 and balance< 9999, "b", balance > 10000 and balance< 24999, "c" , balance > 25000 and balance< 49999, "d" , balance > 50000 and balance< 99999, "e" , balance > 100000, "f" ) but for some reaason I am not getting the desired results. My logic for this is based on this: 1 - 2500 = a 2501 - 9999 =b 1000 - 24999 =c 25000 - 49999 =d 50000 - 99999=e 10000+ =f
Fitch Posted July 28, 2003 Posted July 28, 2003 I like to keep things simple: Case( balance < 0, "credit", balance = 0, "paid", balance < 2501, "a", balance < 10000, "b", balance < 25000, "c" , balance < 50000, "d" , balance < 100000, "e" , "f" )
-Queue- Posted July 28, 2003 Posted July 28, 2003 If balance = 1, 2500, 9999, 10000, 24999, 25000, 49999, 50000, 99999, or 10000, you will receive no result with this calculation. Try using greater/less than or equal to, as in "balance >= 1 and balance <= 2500", etc.
kenneth2k1 Posted July 28, 2003 Posted July 28, 2003 Actually, you will get a result with these values: If: Balance = 1: "a" = 2500: "a" = 9999: "b" = 10000: "c" = 24999: "c" = 25000: "d" And so on...
Fitch Posted July 29, 2003 Posted July 29, 2003 Just to clarify: -Queue- is referring to the adydas calculation, kenneth is referring to mine. It's simple and it works.
Recommended Posts
This topic is 7858 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