Jump to content
Server Maintenance This Week. ×

Calculation of Related Record


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

Recommended Posts

Hi


I need some help on the calculation of record count of related record in the Main page where related records from a single input form.

Thanks in advance
Ken Chan

TEST.fmp12

Link to comment
Share on other sites

A couple of things to consider when posting so that you'll get the maximum help:

- describe the problem in your post, perhaps we can help by the description without having to download a file first

- for your file, describe what field you want to change and what it should do (count all related records, count only some records,...)

 

Doing a count is as simple as using the Count() function and pointing it to a related field (usually the primary key of the child table).

Note that this calculation will be unstored by nature so it will recalculate its value every time you display the field.  Which is ok for small databases but can quickly become a performance hit if there are many related records or you want to use that calculated filed in a report with many parent records.

Link to comment
Share on other sites

Hi Wim,

Thanks for the advice.

I am developing a small inventory system to monitor movements of stocks. 

When we do goods receiving, there are multiple item code inside a Goods receive form. From the main inventory screen, the items that has related records match it will be displayed in the portal. 
 

For example in inventory, item EGG. 

In the goods receive form, I got multiple items scanned from barcode. There will be multiple line items of egg scanned which we receive 3 times. At the inventory screen will show 3 lines related to it. So I want to count that related 3 lines only without the rest of the items.


Thanks a lot.

Link to comment
Share on other sites

An inventory system is a prime example of a system that will become gradually slower over time if you depend on calculated fields for totals.  As the number of in/outs grows over time and use unstored calcs for things like Qty-on-hand and other such items, you will get degraded performance as the system grows..

It definitely is something to consider based on what you know of how much data the system will need to deal with as time goes by.  Design choices you make now can have a serious adverse effect later.

One way to counter that is to make the process that scans the item update the count field on the parent with each scan (or when the user indicates that are done scanning).  That way the count field will be just a static number field.  Post back if you have any questions about this.

Link to comment
Share on other sites

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