8 Replies Latest reply on Apr 8, 2017 6:11 PM by philmodjunk

# Summary field to use in the same body that generated it.

Hello FM community:

First of all, I'd like to thank those who have taken the time to respond. The support has been excellent. As a result, I'm back asking for more help.

I'm creating a time tracking solution. Two jobs were worked on this particular day and times. The total number of hours worked on this day was 15.51(summary field). Ultimately, what I would like to do is take those hours, calculate regular hours (8), overtime hours (4), and double overtime hours (3.51) and allocate them based on the percentage of hours worked on each job. I already have the formulas ready. The result will be:

Job 1 (3.2 reg hours), Job 2 (4.8 reg hours) = 8 regular hours

Job 1 (1.6 overtime hours), Job 2 (2.4 overtime hours) = 4 overtime hours

Job 1 (1.4 double overtime hours), Job 2 (2.11 double overtime hours) = 3.51 double overtime hours

Basically, they're sharing the hours proportionately despite the length of time worked on each job individually. What I really need is to be able to take the value 15.51 from that summary field and put it back to where the number 148.01 appears. I've tried the getsummary function and creating a different summary field with no success. I'm not sure if it's possible or if I simply need to create a number field to plug the 15.51 number back into the body in order to calculate regular, overtime and double overtime allocation.

I'm c

Any help on this matter would be greatly appreciated. Thank you in advance.

• ###### 1. Re: Summary field to use in the same body that generated it.

I can't quite follow the design of your layout.

Can you get the subtotal, 15.51 to appear in a sub summary part? If so, GetSummary can be used to access the same value to use in a calculation.

• ###### 2. Re: Summary field to use in the same body that generated it.

the 15.51 is from a summary field

• ###### 3. Re: Summary field to use in the same body that generated it.

That doesn't answer my question.

Can you get the total that you need by placing it in a sub summary part?

If you can and you describe how you set up that sub summary part, I can tell you how to use GetSummary to get the needed subtotal to use in your calculations.

• ###### 4. Re: Summary field to use in the same body that generated it.

I hope this helps:

I subtracted the time out from the time in to calculate the time worked. Then I summed the time worked to get the time worked day. Then I created the summary field by summing the TimeWorkedDay that you see above.

• ###### 5. Re: Summary field to use in the same body that generated it.

Can you get this value, 15.51 to appear on your layout in your summary field or not?

• ###### 6. Re: Summary field to use in the same body that generated it.

yes

• ###### 7. Re: Summary field to use in the same body that generated it.

I think i got it. I wasn't too familiar with the concept of a break field. With a little trial and error, I figured it out. Thank you for making me think.

• ###### 8. Re: Summary field to use in the same body that generated it.

You go it. The "sorted by" field of a sub summary part is the same as the "break" field parameter of GetSummary. The only significant difference is that GetSummary requires that the break field, the summary field and the calculation using getsummary all have the same context, where the break field for a sub summary part can be from a related table.