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.

Calculation Fields referring to previous record

Featured Replies

Hello,

I'm trying to determine the best way to set up a running calculation that uses previous records as the base.

Imagine, for example, 4 players play a game for the first time. The base score all players start with is 5000.

During that game, Player 1 gains 100, Player 2 gains 50, Player 3 loses 50 and Player 4 loses 100.

The NEXT time they play the game, I would like their base scores to reflect the changes from the last game (so, new scores would be 5100, 5050, 4950, 4900), and so on.

I've been able to set up relationships within the file to allow the 5000 to be placed, and for all the computations. The problem is, I'm unable to set up a calculation for the second playing, without creating a circular reference.

I have attached a sample file, to illustrate what I'm trying to do.

I'm using FM 5.5

Thanks for any help or ideas you can provide!

Chris

Sample.zip

This seems to be exactly what this template illustates:

http://www.databasepros.com/FMPro?-DB=resources.fp5&-lay=cgi&-format=list.html&-FIND=+&resource_id=DBPros000333

--sd

  • Author

Hi,

Yes, this is very nearly what I want. There's only one difference -- I'm not looking to create a running tally of ALL the records...just the ones that are 'related.'

Take a look at the sample file (which I've updated a bit from the first post). You can see in Record 1, that "Bob" playing game #1, started with a rating of 5000, and added 100 points.

Bob shows up again in Record 5, but playing a different game (game id #2) - again, he starts with a rating of 5000 and loses 33 points.

His final time is in Record 9, playing game #1 again.

What I NEED is for the "Base Rating" in Record 9 to reflect the "New Rating" from Record 1...so his starting rating would be 5100.

You can see my attempts at relationships and calculations. Obviously, this is not correct; but I think I'm on the right track. The "Lookup" from the LULAST file you showed me cleared things up somewhat...

Thanks!

Chris

Sample.zip

Edited by Guest

Since your version of filemaker lacks the GetNth( function, should you exploit this templates mechanincs:

http://www.nightwing.com.au/FileMaker/demos/CalculateDown.zip

--sd

  • Author

Hi,

Yes, I saw that one too...it's pretty close. The problem is it relies on serial number (which is fine). And, then, each record has a 'previous serial number) which is the current serial number -1. In my case, there may be hundreds of serial numbers before the same 'game id' comes back.

Chris

I could only hope you can find the money for an upgrade, I havn't touched fm5 ever since fm7 came out some 4 years ago. Todays version is FM9...

--sd

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.