Method Community

 

Grid subtotals in calculations

Last post 03-12-2013 9:16 AM by Anonymous. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 09-27-2011 12:24 PM

    Grid subtotals in calculations

    Is there are way to use grid subtotals to calculate a field?  If so, how do I find out the names of the subtotal fields?

    For example, if I wanted to calculate estimated revenue per hour in a work order, first I would add a field EstRevPerHour.  Then I would want to take the Amount subtotal from the Tasks & Materials grid and divide it by the Est Hrs subtotal.  I know how to set up the Action to do the Basic Math Calculation.  I just don't know the names of the subtotal fields so I can reference them.

  • 09-27-2011 2:15 PM In reply to

    Re: Grid subtotals in calculations

    Answer

    JKM@SA,

    The grid subtotals are dynamically calculated and are not actually fields but you can use the Get Sum action, to get the sum of a column in a grid. 

    So in this case use the get sum action and get the first total, use another get sum and get the second total and then divide those and put it onto a field on the screen. You may even want to place these actions in the After Update or After edit actions of a grid.

    -Michael

    Michael Melo
    Product Manager
    Method Integration Inc.
    Website: http://www.method.me
    LinkedIn: http://www.linkedin.com/in/MichaelMelo
  • 03-11-2013 5:11 PM In reply to

    Re: Grid subtotals in calculations

    Is there any way to add other functions to these dynamically created "rows."  I would like to be able to average a column instead of subtotaling - but keep it in the grid for ease of exporting and printing if necessary.
    Any suggestiong?

  • 03-12-2013 9:16 AM In reply to

    Re: Grid subtotals in calculations

    bcr_garrett:

    Is there any way to add other functions to these dynamically created "rows."  I would like to be able to average a column instead of subtotaling - but keep it in the grid for ease of exporting and printing if necessary.
    Any suggestiong?


    Hi Garrett,

    Only subtotals may be part of the grid itself. You can certainly calculate an average for a grid's column, however that would need to be displayed elsewhere on the screen such as within a label or a textbox. The other alternative is creating a custom report that will display the values exactly as you see fit. You'd still need to develop the action logic to loop through each row in the grid to count them, create a sum, and then calculate the average to output.

    -Angelo

Page 1 of 1 (4 items)