5 Replies Latest reply on Apr 30, 2013 9:18 AM by philmodjunk

    Text Manipulation



      Text Manipulation


           I've been successful adding up working hours that are in the body of my layout in a sub-summary.  However, I want to label any hours greater than 1 as "Hrs.".  If it is equal to 1 label it as "Hr." and if no hours then label it with nothing, "".  I get it to work in the body but it does not work properly in the sub-summary.  Any ideas?

        • 1. Re: Text Manipulation

               Hrs Label is a calculated field based on the Hours field it is next to?

               Hrs Sum Label would be based on the Hours Sum field?

          • 2. Re: Text Manipulation

                 I show hours each day in the body of the layout.  In the sub-summary I sum those hours.  In the body I use this calculation:

                 If(ST Hours > 1; "Hrs.";If(ST Hours = 1; "Hr."; ""))

                 ST = Straight Time

                 The calculation works great in the body but not in the sub-summary.  If the last day (Friday) I only worked 1 hour,  the body would show "1 Hr." as it should but if I had worked 33 hours that week the sub-summary would show "33 Hr."  It seems to follow the last data (Friday) in the body.  If I change the last data (Friday) to 2 hours then the sub-summary will show "34 Hrs.".  If I did not work on Friday, the sub-summary will show "32" with no text.

            • 3. Re: Text Manipulation

                   As DavidAnders stated above, you would have a different calculation in your sub-summary.  You don't state all your field name, but you should have a summary field that totals ST Hours for the week.   You would use the summaryST Hours in your calculation for the sub-summary.

              • 4. Re: Text Manipulation

                     In my sub-summary the ST Hours are summed up for the week in a field called "Weekly ST Subtotal".  The actual numbers add up perfectly.  However, the text doesn't work.  I am using the following calculation for the text in the sub-summary: If(Weekly ST Subtotal > 1; "Hrs.";If(Weekly ST Subtotal = 1; "Hr."; ""))  In the body of the layout it works using: If(ST Hours > 1; "Hrs.";If(ST Hours = 1; "Hr."; "")).  Why won't this work?

                • 5. Re: Text Manipulation

                       To access the subtotal shown when you put a summary field inside a sub summary layout part in a calculation, use the getSummary function. Specify the same break field in this function call as you use for the "when sorted by" field in the sub summary part setup.