Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Portal Difference between records


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

Recommended Posts

Posted

I have a single portal on my layout where one of the fields is a number field. For each line of the portal I need to show the difference between the numeric value for that record and the previous record.

For example

Rec Num_Value Diff

1 3

2 5 2 (i.e 5-3)

3 9 4 (i.e 9-5)

4 14 5 (i.e 14-9)

5 21 7 (21-14)

etc.

The difference field will show the difference between that record and the value in the previous record.

I guess it must be via a calculation field but I really dont have any clue how to start

Any help please

Thanks

Posted

With tools availiable can't I see other ways than by script turning the numbers into a pilcrow delimited list in every record where you then use this custom function:

http://www.briandunning.com/filemaker-custom-functions/detail.php?fn_id=39

...with the parameter (the list) you recieved from the previous record. should you loop yourself thru all records while setting a new field xor-ing its list with the previous list.

--sd

Posted

You need a relationship to the previous record. If your records have consecutive and contiguous serial numbers, you can define a calculation field PrevID =

SerialID - 1

Then define a relationship:

table::PrevID = table 2::SerialID

The difference =

Value - table 2::Value

If you cannot guarantee that serial numbers are contiguous (e.g. records may be deleted), make the relationship:

table::SerialID > table 2::SerialID

and sorted on table 2 side by SerialID, descending.

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