1 Reply Latest reply on Jul 23, 2015 1:46 PM by philmodjunk

    Summary fields and portals



      Summary fields and portals







      I've been beating my head against the wall for the last few hours with this problem. I am trying to figure out how to show a sum of all the hours worked by a person in a timesheet. I am able to summarize entire fields using the SUM() command (rather than running an actual summary field) but I have no luck with any of the commands when trying to summarize in a portal.

      Relevant table descriptions:

      Timesheet - Time info for every employee is stored here

      Employee Listing - List of employees

      Here's my table setup:

      Overlord -> Timesheet -> Employee Listing -> Timesheet 2

      The relationships are as follows:

      Overlord --SelectedDate---> Timesheet --EmployeeID--> Employee Listing --SelectedDate---> Timesheet 2

                    --SelectedProject->                                                                              --SelectedProject->


      I have a layout based on Overlord and a portal that is based on Employee Listing which shows the filtered out employees but the summary field(Based on a SUM() function that sums up the hours in Timesheet 2) shows the total for all employees rather than each individuals ones.

      I've tried changing them to summary fields but those only show the first entry in each timesheet.

      What should I be doing?


        • 1. Re: Summary fields and portals

          The details are not fully clear, but it would seem that the portal filter is the problem. Sum sums related records at the data level. What objects, such as a filtered portal might be present on a layout have no effect on how it evaluates. Both the sum function in the parent record and a summary field defined in the portal's table should both show the same result when placed directly on the overlord layout--a total based on all related records, not a total based on those that pass a particular portal's filter.

          To show the total from a filtered portal, Make a copy of that portal--so that it has an identical portal filter and is based on exactly the same table occurrence, reduce it to just one single portal row and put a summary field defined in the portal's table inside that one row portal. This summary field should show a total or other aggregate value based only on the related records that pass through the portal's filter.

          Note that there are limitations to this approach that sometimes require using other methods to get the correct subtotal.