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.

Case statement troubles

Featured Replies

Hi,

I am trying to calculate the results of a field ussing a CASE statement. I have the following fields:

Quantity (text)

Min Quantity (text)

Max Quantity (text)

LevelWarning

LevelWarning is a calculation with the following:

Case (

Quantiy ≤ Min Quantity-1; "Inventory is LOW";

Quantiy ≥ Max Quantity+1; "Inventory is High";

"Inventory level is OK."

)

This is not write however as it does not return the expected result... just what seems to be random (tho im sure its logical in its own right)

Any thoughts on ware im going wrong would be much appreciated.

Thanks in advance.

An example of input and result would be useful, but I'll venture a guess anyway: either change the field types to Number, or at least use =

Case (

GetAsNumber ( Quantity ) ≤ GetAsNumber ( Min Quantity ) - 1 ; "Inventory is LOW" ;

GetAsNumber ( Quantity ) ≥ GetAsNumber ( Max Quantity ) + 1 ; "Inventory is High" ;

"Inventory level is OK."

)

BTW, assuming quantities are integers, a ≤ b - 1 can be written simply as a < b.

  • Author

Sorry for not being more clear in my post, however your 'reading between the lines" was absolutely correct.

The example you provided worked perfectly. Thanks very much.

For anyone else who may be searching for this answer...more details...

I want to assign a range of inventory level for items. IE: 10 is the minimum to have on hand and 50 is the maximum. If the level drops bellow the min, i want to be notified, if above the max i also want to be notified. Otherwise, the level on hand is OK.

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.