R2D2 Posted May 4, 2009 Posted May 4, 2009 Hi ! I'm wrestling with my database and now I'm stuck with this problem: There are invoices in one table. They have Status: "not ready", "waiting for approval" and "approved". The accounting can choose which invoices are shown in the portal. The problem is how to present the Total of each sub group, when portal data is changed. Now it shows only "Grand total" of all sub groups (i.e. even though the invoice is not "approved" yet, it's sum is added to "total") I hope you understood... ???
LaRetta Posted May 4, 2009 Posted May 4, 2009 (edited) The accounting can choose which invoices are shown in the portal. If you are filtering the portal by the status, it shouldn't matter ... you should get the total of all invoices which appear in the portal. You can use cTotalInvoices in Parent as: Sum ( thatPortal::InvoiceAmt) or if you have a summary field in Invoices, Just place that on the layout. Place either of these fields outside the portal. So your relationship would be: MainTable::ParentID = Invoices::ParentID AND MainTable::gStatus = Invoices::Status Edited May 4, 2009 by Guest Added relationship example
Søren Dyhr Posted May 4, 2009 Posted May 4, 2009 Use Ugo's method: http://fmforums.com/forum/showpost.php?post/266487/ Instead of Count( use Sum( --sd
R2D2 Posted May 4, 2009 Author Posted May 4, 2009 Thanks LaRetta and Soren ! That Sum -function worked well enough. Those relations are still quite tricky for me, so I find this plain Sum easier.
Recommended Posts
This topic is 5682 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