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.

Question on adding default value in a calulation unless field says different

Featured Replies

Hi Everyone. I hope someone will be able to shed some light on this one for me. I currently have a calculation set up to provide a numerical value. The equation is below.

If(GetAsNumber(%) =""; Total Amount applied per day; Extend (Total Amount applied per day) * Extend (Retention factor)*%*1000/6000)

I would now like to include an addition to this such that it will take into account a percentage 1-100% that will be included in an additional field so that it looks something like this.

If(GetAsNumber(%) =""; Total Amount applied per day; Extend (Total Amount applied per day) * Extend (Retention factor)*%* NEWPERCENTAGE *1000/6000),

where NEW percentage will, by default always be 100%, unless the field 'NEW PERCENTAGE' contains a manually added value between 0-100%.

How could I do this without needing to manually add "100%" in the "new percentage" field each time I do not have a specific value to add i.e when I leave it blank.

Thanks guys

Try something like =

Let ( [

p = Case ( IsEmpty ( NewPercentage ) ; 100 ; NewPercentage )

] ;

something * p

)

  • Author

Thanks for this

At the moment it is set up as below.

SED = If(GetAsNumber(%) =""; Total Amount applied per day; Extend (Total Amount applied per day) * Extend (Retention factor)*%*1000/6000)

The number for "NEWPERCENTAGE" is pulled across from another database thus I cannot add this script as a calculation when it i set up to pull the value across, so do I need to create an additional field to link it.

I am am amateur so any help would need to be for the IQ of a bin bag! ,

  1. The other question is what is "p"?

Use IsEmpty() not ="".

Is % a field? If so, change the name to something else. It will cause grief in the future.

The number for "NEWPERCENTAGE" is pulled across from another database thus I cannot add this script as a calculation when it i set up to pull the value across, so do I need to create an additional field to link it.

I am afraid I don't follow your description. Perhaps you should tell us more about what this is about. Why are you using Extend() - is this a repeating field calculation? That's probably not a good idea.

The other question is what is "p"?

p is the name of a variable I have defined for the purposes of the calculation. See the help on the Let() function for more.

Is % a field? If so, change the name to something else. It will cause grief in the future.

What grief?

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.