Re: Calculation/Lookup from Previous Record



In article <fbsp18$353$1@xxxxxxxx>, Chris Brown
<cbrown@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Helpful Harry wrote:
In article <fbq49k$oj6$1@xxxxxxxx>, Chris Brown
<cbrown@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Lemur wrote:
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 and Players 2-4 each lose 33.

The NEXT time they play THAT game, I would like their base scores to
reflect the changes from the last game (so, new scores would be 5100,
4967, 4967, 4967).

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 a sample file I can email. In that sample file, in Record 1,
"Bob" played game id #1, started with a rating of 5000, and added 100
points. Chris also played and lost 33 points, so his rating is 4967)

Bob shows up again in Record 5, but playing a different game (game id
#2) - so, again, he starts with a rating of 5000 and loses 33 points.
Chris also played and lost 33 points (so he's at 4967 for game id #2,
as well)

Bob's final time is in Record 9, playing game id #1 again.

What I NEED is for the "Base Rating" in Record 9 to reflect the "New
Rating" from the last Bob played game id #1 (which was in Record
1)...so his starting rating would be 5100, and Chris' base rating in
Record 10 (for game id #1) would be 4967.

I have created self-joins and lookups, but nothing is allowing me to
pull the information from that record forward (again, I have a sample
file, about 30k, that I'm using to test everything).

I'm using FM 5.5

Thank you for any help you can provide! This is driving me a little
batty ;)
GameID/PlayerID
key_Last = GameID -1

multiparameter rel: key_Last::GameID | PlayerID::PlayerID

c_Last Score = rel::Score

If all you want is the very last score, then there's a slightly easier
way. Instead of bothering with the "key_Last", simply create the
Relationship to sort in reverse order (presumably by Date) and then
Rel::Score will be the most recent one wanyway. :o)

quite so Harry! But I just noticed Lemur is using FM5.5. It's been so
long, did 5.5 permit mutiparamter rels? I seem to vaguely remember
having to create dedicated calc keys...

Nope. FileMaker 5.5 doesn't have multi-field relationships. You can
only use one field and it can't be a Calculation on the child side.
You can use a Calculation on the parent side to combine other field
values, but on the child side you have to use Auto-enter fields - which
adds a complication if you want to later change the fields' values, but
you shouldn't have that problem when using unique IDs rather than
something like a Player's Name.


Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)
.



Relevant Pages

  • Re: SOT: IPDB Agrivation
    ... IPDB, provided the administrators approve. ... she gave that particular game a very high rating, ... Chris Wolfe contribute to the IPDB! ...
    (rec.games.pinball)
  • Re: Calculation/Lookup from Previous Record
    ... In article, Chris Brown ... Imagine, for example, 4 players play a game for the first time. ... I have a sample file I can email. ... What I NEED is for the "Base Rating" in Record 9 to reflect the "New ...
    (comp.databases.filemaker)
  • Re: UK Lotto Only an Average of 3 Plays made per Game by Each Participant
    ... Saturday game I enter has at least 4 and I suspect probably double ... that whereas the UK Lotto averages out over 1579 games to about 3 ... I gave you the benefit of the doubt despite your calculation failing obvious dimensional analysis tests because it produced something akin to the right answer. ... Your 'novel calculation' indicates an average of less than 2 tickets per punter nowadays. ...
    (rec.gambling.lottery)
  • Re: Accessing a locked surface
    ... calculation, it'll be as slow. ... I'm doing a classic 2D game, like there are many on the market. ... locking, computing, and surface unlocking. ... I guess that using Direct3D ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: NAC 2008 Day 1
    ... Of the 25 players who advanced to day 2, only one of them didn't have a ... game win. ... �Looks like the calculation was just about right to me. ... On an unrelated note: cool deck that won the NAC. ...
    (rec.games.trading-cards.jyhad)