March 22, 200619 yr Hi all I am trying to get a calculation field called GST working to fuction like an if, elseif statement. THere are two situations where this calulation needs to be done. GST= If Classes::type="Movement and Music" then cost*.07 or GST= If Classes::type="birthday" then cost+14 Here is what I had for the first part. GST= If ( Classes::type="Movement and Music" ; cost*.07 ) THis works for the first instance. When I add: If ( Classes::type="birthday" ; cost+ 14 ) Filmaker complains that there is an operator missing. I tried adding an or in between but that seemed to give a value of "1" when either case occurs. Any Ideas about what I might be doing wrong?
March 22, 200619 yr I prefer the Case, it is easier to read and to writht Off of the top of my head, try: Case (Type="Movement and Music"; cost*.07; Type="Birthday"; cost +14) or maybe Case (Type="Movement and Music"; cost*.07; Type="Birthday"; cost +14; cost) In case you want a cost when it doesn't meet the critera. HTH Lee
March 23, 200619 yr Author Lee Thanks for your reply. What a wonderful thing this forum i!! The "Case" function works like a charm much better than the if statement. Now my problem is the result of the calculation field needs to rounded to two decimal points. Here is what I have Case (Classes::type="Movement and Music" ; cost*.07; Classes::type="instrument"; cost*.07; Classes::type="birthday" ; cost*.07; Classes::type="CD"; cost*.07) I figure it has something to do with the Round function but I can't figure out how to use it. Thanks in advance.
March 23, 200619 yr You got it: Enclose the whole thing in the Round. Round ( Case (Classes::type="Movement and Music" ; cost*.07; Classes::type="instrument"; cost*.07; Classes::type="birthday" ; cost*.07; Classes::type="CD"; cost*.07) ; 2) HTH Lee
Create an account or sign in to comment