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.

If.. then copy value from another field

Featured Replies

I think this should be a simple calculation, but I can't get it to work.

For field3, I need to copy the value from field1 if the value in field2 is 1.

Details:
I have a time series table, each record is a year (field is [year], values are 1972, 1973, 1974, etc.).  This is a country's timeline, during which some years it is at peace.

I have a field [firstyearpeace] that is a number field with values of either 1 or [blank]. If it is a 1, that means that year is the first year of an era of peace.  

I have another number field [peacestartcalyr] that I want to be the calendar year of the first era of peace.

I think this should be an If.. Then calculation (or perhaps a Case calculation? I'm using 12 Pro Advanced).

In the calculation formula for [peacestartcalyr] I have:

If ( firstyearpeace = 1 ; GetField ( year ) ; )

When I click "OK", nothing happens.  I already have the  [firstyearpeace] and [year] fields populated.  What am I doing wrong?  Syntax? Should I be using Case?  If so, what syntax for that?  I don't get an error when I hit OK from the Specify Calculation dialog box.  If the value in the  [firstyearpeace]  is blank, I want it to leave  [peacestartcalyr] blank.

 

Case( firstyearpeace = 1 ; year )

  • Author

Thank you so much Bruce.   At first I couldn't get it to work, then I remembered some (all?) calculations are only performed after something is freshly entered in a field (in this case, entering "1" in [firstyearpeace].  In my situation the appropriate [firstyearpeace] fields were already populated with 1s, which is why it didn't work the first time.  My workaround: I did a Find for all those with a 1, removed it via Replace Field Contents, put the 1 back,  Replaced Field Contents again, and then all my peacestartcalyer fields happily populated with the correct year.  Is there a setting somewhere to make the calculation happen automatically when fields are already populated -  something like "Relookup Field Contents" for Calculations?

You're leaving something out.

 

None of that should be necessary.

 

Did you define the field as a calculation field or as an auto-enter calc. Sounds like you defined it as an auto-enter calc. 

 

It would be good to post a copy of your file, or a clone, or simplified example.

Might be a "storage options" thing if it is a calculation - change to - do not store - will give you instant refresh

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.