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.

Multi Criteria Case Statement

Featured Replies

Hello All,

I seem to be having a little trouble with the syntax for a case statement. I am looking to set a field as follows;

Tickets::status_paid=

If Tickets::status="Billing"; "Unpaid"

If Tickets::status="Paid Billing" or Tickets::status="Collected"; "Paid"

If Tickets::status="Unavailable"; "?"

Else Tickets::status

I am confused as to where all the brakets and parens go so I keep getting an error when I try to set the calculation. Any help would be greatly appreciated.

When you have multiple tests, it works better to use Case() than attempting to use If() particularly since you must nest If()s because (natively) they only accept two results).

Try:

Case (

Status = "Billing" ; "Unpaid" ;

Status = "Paid Billing" or Status = "Collected" ; "Paid" ;

Status = "Unavailable" ; "?" ;

Status

)

LaRetta

  • Author

It seems to come up "Unpaid" on all. It looks like it needs some "{}" brackets but I can't figure it out from the example FM gives.

Case ( test1 ; result1 {; test2 ; result2 ; ... ; defaultResult} )

Edited by Guest

Well, this is what it does for me (attached).

test_tickets.zip

Is the Tickets::Status field from a related table?

  • Author

No it's in the same table. I think I have a case of Friday burn out. I can't see why yours is working and mine isn't. I think I'll call it a day and look at it Monday.

Thank you so much for your help.

Edited by Guest

  • Author

Doh!! OK, Definitely a Friday thing. The field I was using to test with was from the wrong table. I'm going home. Lol

Thanks again

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.