Jump to content

This topic is 7858 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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","")

Posted

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

cool.gif

Posted

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

Posted

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. smile.gif

  • Newbies
Posted

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

Posted

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" )

Posted

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.

Posted

Just to clarify: -Queue- is referring to the adydas calculation, kenneth is referring to mine. It's simple and it works.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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