netcode Posted March 17, 2009 Posted March 17, 2009 (edited) Hey there, I have a calculation set up to find the total of a few related records via the sum function. Here is how it works. I have a Contracts Table that is Related to a table called InKind. They are related through a unique ID number that is given to each Contract in the Contracts table. Each entry in the InKind table has a cash value. The calculation resides in the Contracts table and is as follows: Sum ( AFF_InKind::Cash Value ) However it doesn't work that way.... First Issue: The InKind table is being displayed in a portal, when I delete a portal row the TOTAL does NOT update. If I add a portal row or update the cost of one of the entries the total will calculate without issues. Second Issue: I have multiple TO's of the contracts table and the inkind table. The calculation only allows me to pick one table for "calculate in the context of". So when I am working in the other TO's it is showing me the calculated total from the wrong table. Just found this... It even says in the help file: "Summarizing data in portals You can summarize data that's in a related field displayed in a portal. The portal can contain records from a related table or from the same table, using a relationship defined from and to the current table (a self-join). To summarize data in portals: 1. Create a calculation field in the table in which you want the summary to be displayed. See Defining calculation fields for more information. 2. For the calculation field, define a formula that includes an aggregate function for the type of summary calculation you want to perform. For example, if you are in the Invoices table and want to define a calculation to total the related values in the Price field of the LineItems table, use the formula Sum(LineItems::Price) 3. Place the calculation field on a layout of the table in which it is defined. See Placing and removing fields on a layout for more information. " But that doesn't work ... frustrating Edited March 17, 2009 by Guest
Søren Dyhr Posted March 17, 2009 Posted March 17, 2009 Please upload a file showing this, and only this! --sd
netcode Posted March 19, 2009 Author Posted March 19, 2009 (edited) I figure out a solution. It had to do with the record not being committed. So I simply just created a script that would delete the portal row and then commit. It works now : Funny how its always something simple like that. However I haven't fully tested out the second issue yet, as the first one was solved I moved onto something else. I will be doing that very soon and I will let you know the outcome **Outcome: I guess the context will change dynamically with the relationship? Not sure but it seems to be working fine. Edited March 19, 2009 by Guest
Recommended Posts
This topic is 5787 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 accountSign in
Already have an account? Sign in here.
Sign In Now