Monthly Sum Field

Viewing 2 reply threads
  • Author
    Posts
  • May 16, 2023 at 7:21 AM #49428

    Tim Flick
    Participant

    I have a field in my form named amount. I use this field to store an expense for a certain date. I would like to display on a form in a field the total expended for a month. I realize this can be displayed in a list view but I would like to display in a field on a form

    Thanks in advance Tim

    May 17, 2023 at 10:51 AM #49431

    Brendan
    Keymaster

    Hi Tim,

    The tricky part is getting the list of records for just the month and then total that up. You could do it, but it would require writing some JavaScript in a Script field to get the list of records, loop through them to find which records match the month you’re interested in seeing and then totalling up the value from your amount field, then returning that value so it displays in the script field on your record.

    There is a simple function called form.getTotalOfField(fieldID); to get the total of a field from a form, but the tricky part in your case is to get the total just for a specific range of records.

    How’s your scripting ability?

    Thanks,

    Brendan

    May 17, 2023 at 2:05 PM #49432

    Tim Flick
    Participant

    Minimal but thanks for responding

Viewing 2 reply threads

You must be logged in to reply to this topic.