Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Calculation using If for two cases

Featured Replies

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?

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

  • 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.

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

  • Author

Lee

Thanks very much that works perfectly.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.