Topic: how to sum total of column showed in TableGrid1

dears How can I sum the values displayed in a column of a tablegrid and place them in a label? The name of the tablegrid is tablegrid1, and the column is called hoursMissed in the myabsences table. Of course, the result shown is the outcome of certain filters.

Re: how to sum total of column showed in TableGrid1

Hi,
From your post, I assume that you are not currently using standard MVD functionality to display tablegrid footer values.
In that case, have a look at the attached example and simply replace 'fkcount' with 'fksum' in the script and adjust the column number to be the column that contains 'hoursmissed'.
However, if you are already using standard MVD functionality to display tablegrid footer values, you do not need lines 3-4 in the script.
Derek.

Post's attachments

Attachment icon column footer to edit field.zip 446.33 kb, 27 downloads since 2024-03-24 

Re: how to sum total of column showed in TableGrid1

derek wrote:

Hi,
From your post, I assume that you are not currently using standard MVD functionality to display tablegrid footer values.
In that case, have a look at the attached example and simply replace 'fkcount' with 'fksum' in the script and adjust the column number to be the column that contains 'hoursmissed'.
However, if you are already using standard MVD functionality to display tablegrid footer values, you do not need lines 3-4 in the script.
Derek.


Thank you very much for your answer , but what I need not the total number or rows , what I need is the total summation  of column ...like if I have

5
2
4
2
5
in column  to have summation  of them in label (18)

Re: how to sum total of column showed in TableGrid1

As I already wrote in my previous answer

 replace 'fkcount' with 'fksum' in the script

See new attachment.
Derek.

Post's attachments

Attachment icon footer formula value example.zip 446.53 kb, 29 downloads since 2024-03-24 

Re: how to sum total of column showed in TableGrid1

derek wrote:

As I already wrote in my previous answer

 replace 'fkcount' with 'fksum' in the script

See new attachment.
Derek.


Sorry it is my mistake I didn't read carefully


to be honest you are genius !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Thank you very much