Jump to content

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

Recommended Posts

Posted

Hi. I know how to summarize related data (Calc=Sum(Relationship::field))

However, I need a running total in a portal (like a bank book). Can ANYONE help?

Thank you in advance.

Posted

Hmm, the data is going to need to be in the source file to show in the portal. You will need to create a calculation field in each reocrd that sums all PREVIOUS records. I am not sure though if this is possible, at best it will be quite difficult.

Now of course you could script a loop to calculate the numbers and simple stick them into the field, or an autoentered calc which inserts the number at the time the record is created.

Posted

Thanks. Actually, in the simplest form, no data needs to be in the Source file. Imagine the portal with just 2 fields: Number, and Running Balance.

Row 1, Number = 5, Balance = 5,

Row 2, Number = 7, Balance = 12... and so on.

The loop script could work, but I was hoping for a simpler Summary, or Calculation field that would avoid the potential problems of manual scripts, especially in a complex accounting setup.

Posted

Solved, sort of, a Portal with a Number field and Running Balance.

In the Items file create 5 fields:

Master ID = Match field from Master File

Line Item ID = unique serial number for each line item

Number = Number (the user enters in the Portal)

Summary = Total of Number (check Running Total)

Balance = Calculation: GetSummary(SummaryField, Line Item ID)

In the Master File, put the Number and Balance fields in the Portal.

Make the Portal sort by Line Item ID.

The trick to the whole thing is to have a script that makes the Found Items file match the portal. (The summary calculations are taking place in the Items file, so the running total must be applied to the correct set of records. Too bad the Summary fields can not reference fields in related files.... FileMaker Inc???)

First in Items make a script that Sorts by Line Item ID.

(Perform a sort, then create a script with a Sort command to save it.)

In the Master DB, the script:

Freeze Window

Goto Related Records [items, show only related Items]

Perform Script [External, Items, Sort by Line Item ID]

Refresh Window

Now the portal will display user-entered numbers in the portal with a running total, as long as the above script is invoked after any changes. Note if you go to the next Master Record, the script must be applied, to make the Found Set in Items match the current portal. (FileMaker Programmers, I HOPE you read this!)

This topic is 8428 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.