3 Replies Latest reply on Jan 6, 2017 3:57 PM by lindseym

    Qty Subtraction - Not getting the right answer

    lindseym

      Howdy,

       

      I'm working on a layout with a sub-summary part definition.

       

      Actual Qty is a summary calculation with running total and restart summary selected.

       

      Screen Shot 2017-01-06 at 2.37.47 PM.png

       

       

      The first issue I am having is that the difference column (WO QTY - Quantity Qty) seems to be factoring other numbers after the first line item.

       

      Screen Shot 2017-01-06 at 11.16.58 AM.png

       

       

       

      The second issue, I want to figure out how to show it if the difference is more than the work order to show as a positive number, if it is less, to show as negative. I think I can do this with a calculation like: If the difference between WO and Actual is  greater than WO then add a + sign before the difference and format green. If the difference between WO and Actual is less than WO then add a - sign before the difference and format red. I am sure I can figure out that calculation. Just want to make sure that sounds like a viable option.

       

       

      Here is what I am getting in preview mode:

      Screen Shot 2017-01-06 at 2.33.40 PM.png

       

      Thanks

      -L

        • 1. Re: Qty Subtraction - Not getting the right answer
          philmodjunk

          These days, summary reports work just fine in Browse mode--no need for preview mode normally. Am I correct that each row in your preview represents a subsummary layout part and thus a group of records?

           

          If so, calculations that reference a summary field will normally get a "grand total" result from the summary field--a total based on all records in your found set rather than just the records grouped with a given sub summary part.

           

          To get the subtotal value that you see in a sub summary part, you would need to use the getsummary funciton.

           

          GetSummary ( SummaryField ; BreakField )

           

          Where BreakField is the same field that you specify as the "sorted by" field for your sub summary part.

           

          And in this example, I see no need for setting up the summary field as a running total as it is not actually used in that capacity anywhere in your examples--assuming that I am correct about your use of sub summary layout parts in your example.

          • 2. Re: Qty Subtraction - Not getting the right answer
            bigtom

            I think you might be using a summary when you do not want to.  Why is not the difference simply the WOQTY - ActQTY?

             

            This was puzzling me from your previous topic as well.

             

            For the green and red you simply use conditional formatting.Self > 0 in the conditional calc should give you what you are looking for on a green number. Similar thing for red.

            • 3. Re: Qty Subtraction - Not getting the right answer
              lindseym

              philmodjunk

               

              I used the preview mode, because when I use browse, It shows the full height of my fields (before it's resized), and most only need to be 1-2 lines. Just a habit.

               

               

              I believe you are correct.

               

              I have two sub summary parts -- depending on how you sort them.

               

              They never show at the same time, so each row is a record- to my understanding.

               

              I did the get summary (thanks for the explanation on break field) and I have it working.

               

               

              bigtom thanks for the reminder about Self! I will for sure use conditional formatting.

               

               

               

              Happy Weekend!!

              -L