July 27, 200322 yr Newbies 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","")
July 27, 200322 yr Hi, here is the syntax to use... If (balance = 2500, "a" , If (balance = 5000, "b" , If (balance = 50000, "e" , ""))) Ed.
July 27, 200322 yr 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
July 27, 200322 yr 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
July 28, 200322 yr 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.
July 28, 200322 yr Author Newbies 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
July 28, 200322 yr 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" )
July 28, 200322 yr 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.
July 28, 200322 yr 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...
July 29, 200322 yr Just to clarify: -Queue- is referring to the adydas calculation, kenneth is referring to mine. It's simple and it works.
Create an account or sign in to comment