I see two ways to do what you want, but a few details bother me and I'd like clarification on those points first to avoid confusion when you try to implement one of these suggested solutions:
Sum ( Time Spent In SideA)
Sum ( Time Spent In Side Instance ) / Total Video Time Length
Sum ( Video Time Length )
Are these exactly what you are using here?
Sum has two basic formats:
Sum ( field1 ; field2 ; field3 ) which is the same as just using field1 + field2 + field3
Sum ( relatedTable::Field1 ) which computes the sum of Field1 from all related records in the specified relatedTable's table occurrence.
Sum ( field1 ) will produce the same result as just entering Field1 in the specify calculation dialog.
And what kind of field is Total Video Time Length? A summary field?
Your two possible solutions:
- Define calculations in the layout's table (not the portal) that use the Sum function to compute your portal totals.
- Define summary fields that compute these totals in the portal table and change that last portal to be a one row portal to display either these summary fields or calculations that combine the values of several of these summary fields.
With option 2, you may also need a triggered sript to refresh your window each time you save or exit one of the Time fields in the first total to make sure that these totals update promptly.
Hmmm I guess this means I misunderstood the Sum function. I copied/pasted the formulas to my posting, so that's just how I had it.
My goals were this: Add each ENTRY together for the Time Spent field (they spent 8 hours and 34 minutes that day in that part of the cage etc). But just for this one day/record. Not all the records together (although I will need to do that too at some point in time). This was for the "Total Time In Social" field.
Once that works, divide that by the sum of all the Video Length entries, to give me Percent of Time spent in SideA.
Is there something else I should be using other than Sum? I've been using The Missing Manual to help me, but I'm still feeling my way around.
Thank you for all your help. You are a life saver!!!
I gave you two options in my last post.
- The first uses Sum from the parent record (The table your layout lists in Show Records From in Layout Setup...)
- The second uses summary fields to produce the same result.
I've got it now! Thank you very much!