Slats Highlander Posted March 22, 2006 Share Posted March 22, 2006 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? Link to comment Share on other sites More sharing options...
Lee Smith Posted March 22, 2006 Share Posted March 22, 2006 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 Link to comment Share on other sites More sharing options...
Slats Highlander Posted March 23, 2006 Author Share Posted March 23, 2006 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. Link to comment Share on other sites More sharing options...
Lee Smith Posted March 23, 2006 Share Posted March 23, 2006 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 Link to comment Share on other sites More sharing options...
Slats Highlander Posted March 25, 2006 Author Share Posted March 25, 2006 Lee Thanks very much that works perfectly. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6745 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