Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 4508 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Arrrgggggg. I love these undocumented features! !!!

I have four fields.

Period = (1-60 months)

BeginningBalance = GetNthRecord ( EndingBalance ;Get( RecordNumber)-1 )

Credits = Say, 100

EndingBalance = BeginningBalance + Credits

So, Here are the Records

Period...BegBal........Credits..........EndBal

1...............0.................100..............100

2............100................100..............200

3............200................100..............300

4............300................100..............400

....and so on (the dots are spaces)

It calculates perfectly in the root table.

However, I have another table that is indexed to the first table using Period as the relationship

When I try to access EndingBalance from a form using the second table, I get....

Period EndBal

1 100

2 100

3 100

4 100

....it ignores the BegBalance (and I did not make a mistake and reference Credits).

If I take out the GetNthRecord calculation and hard code the number, it works just fine.

I suppose I could start at the first record and step through the found set calculating the Beginning Balance from the ending balance of the last record... but that seems to defeat GetNthRecord.

Has anyone seen this before? Help! :hmm:

Posted

It seems to be calculating as I would expect it to...

I think BeginningBalance field would have to be an unstored calculation since it uses GetNthRecord function - which means it's re-evaluated every time it is referenced. Then, GetNthRecord is context-dependent, which means if you change the found set, or the sort order, it will evaluate differently and that is effectively what you are doing when you are referencing the field from a related table.

I'm not quite sure what your goal is, but another method you could try would be to use a summary field defined to keep a running total.

  • 2 weeks later...
Posted

I would probably experiment more... but my FM12Adv client locks up when I change the calculation.

..summary field. Execellent suggestion. Thanks.

This topic is 4508 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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