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.

Numeric field characteristics

Featured Replies

Hi,

I have a calculation that is looking at a numeric field (NUM):

if(NUM <4; "ok"; "not ok")

(The calculation is actually more involved, but this is the part causing problems...I've simplified the results - "ok" and "not ok" - just for ease of explanation here.)

The problem I'm seeing is that if NUM is left blank, the calculation evaluates it as zero, thus causing the result to be "ok", when I need the result to be "ok" only if NUM contains 1, 2, or 3.

I would imagine that the simplest way to resolve the issue is to put an additional "if NUM is blank then" condtion into the calculation, but for a variety of reasons I would like to avoid this. Does anyone know of another solution?

Many thanks, and apologies if this is a ridiculously simple question! smile.gif

julia

Try,

Case(NUM =""; ""; NUM<4; "ok"; "not ok")

HTH

Lee

wink.gif

A null is smaller than 4, so if you want a different result when IsEmtpty (NUM), you do need to specify this explicitly.

Ciao,

try this calculation:

If(Num * Num / Num <4; "ok"; "not ok")

(if you write some space inside Num, the result will be "not ok". The result will be "" if NUM is left blank, but you setted the CalcField to "not evaluate if all referenced fields are empty")

Hi raybaudi,

I guess it is a matter of what julia wants to be the answer for 0.

0 produces Ok in the other two calculations and Not Okay in yours.

Lee

  • Author

Thanks all for the suggestions - I appreciate it. I tinkered with a few things, and think that a Case() scenario is probably the best bet for this purpose. I forgot to mention that the NUM field is validated upon data entry with a range that doesn't include zero.

I think I'm all set. Thanks again! Much appreciated. smile.gif

julia

Hi Lee Smith,

she said:

when I need the result to be "ok" only if NUM contains 1, 2, or 3.

so I assumed that for 0 she needs "not ok"

I need the result to be "ok" only if NUM contains 1, 2, or 3

I missed that part. Then perhaps the best way would be to say exactly that:

Case ( Position ( "x1x2x3x" ; "x" & NUM & "x" ; 1 ; 1 ) ; "OK" ; "NOT OK" )

Hi comment

your solution is very good !

She also said:

I would imagine that the simplest way to resolve the issue is to put an additional "if NUM is blank then" condtion into the calculation, but for a variety of reasons I would like to avoid this.

So I tried to not use a case function , as it's the same of a multi-if function.

(BTW my calc is good also for decimals!)

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.