Jump 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.

gain or loss between sucessive reccords

Featured Replies

I use the following calculation to determine the investment gain or loss between two successive records. The records are sorted by date descending.

Case

( Get(RecordNumber )>1;Total investment-GetNthRecord ( Total investment;Get(RecordNumber) -1 )

)

The calculation works well except that on the last record in the found set it results in a question mark. How can I eliminate the question mark? I would like the result to be be empty.

What type of field is Total investment? And how many records do you have in the found set?

  • Author

It's a number field. I'm in the process of developing the solution so there are only 14 records. I expect in use, it will grow only to a couple of hundred.

I cannot reproduce your issue.

diff.png

  • Author

Sorry about that. I changed the calculation after I posted it. ! It is:

Case
( Get(RecordNumber ) ≥ 1;Total investment-GetNthRecord ( Total investment;Get(RecordNumber) +1 )
)

It determines the difference between the current and next records.

The file is attached.

Assets.fmp12

Well, if you're on the last record, then this part:

GetNthRecord ( Total investment ; Get(RecordNumber) +1 )

will error out.

You should change your test from:

Get (RecordNumber) ≥ 1

to:

Get (RecordNumber ) < Get (FoundCount)

That will make the last record empty and return a value for the first record (which does have a next record).

  • Author

That did the trick. Thanks for your help.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

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.