Method Community

 

Sum of a grid row

Last post 03-29-2011 11:19 AM by Method_Michael. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-28-2011 8:49 PM

    Sum of a grid row

    Hello,

    I've created a grid for monthly expense items. The first column is the item, followed by 12 columns for the 12 months. I would like to sum the total of each month into the last column. 

    I've noticed there is a 'Get Sum' action, but this only sums up columns. Is there a way to sum vales in the same row?

    Thanks,

    Greg

  • 03-29-2011 8:54 AM In reply to

    Re: Sum of a grid row

    Hi Greg,

    This can be achieved using SQL Overrides. The webinar HERE goes over SQL overrides in Method grids.

    -Michael

    Michael Melo
    Product Manager
    Method Integration Inc.
    Website: http://www.method.me
    LinkedIn: http://www.linkedin.com/in/MichaelMelo
  • 03-29-2011 10:10 AM In reply to

    Re: Sum of a grid row

     Hi Michael,

    Whenever I put ANY SQL into the SQL Override of my Total column, the grid does not display. I tried just putting "SELECT Jan, Feb" which shouldn't even really do anything but the grid is hidden. When I remove the SQL the grid reappears.

    Any ideas?

     

  • 03-29-2011 11:19 AM In reply to

    Re: Sum of a grid row

    Answer

    Hi Greg,


    You don’t actually have to put "SELECT Jan, Feb" you can just type in a field name in the box for example you can just type in RecordID and it will print the RecordID in the column. If you take a look at some of the grids on our Mobile screens you can see this in action. One thing to note is if you are adding numbers together instead of concatenating strings you may have to include checks for null values and do some casting. If the grid doesn't show up it means that there is something wrong with the script you entered.


    If you get stuck on this or need further help you can schedule some paid consulting time with me and we can go over this together.


    -Michael

    Michael Melo
    Product Manager
    Method Integration Inc.
    Website: http://www.method.me
    LinkedIn: http://www.linkedin.com/in/MichaelMelo
Page 1 of 1 (4 items)