Adding a summary Row to a text column

Posted by: jgalera on 5 February 2019, 7:48 am EST

  • Posted 5 February 2019, 7:48 am EST

    Is there any way to calculate the total of a text column where the values of a column could either be a number or a string? I would only have to sum the numbers in the column and ignore the strings.
    ie: if i have a column

    1
    4
    d
    3
    6
    g

    then total would be 14
  • Replied 5 February 2019, 10:44 pm EST

    Hi,

    For this, you need to create your own custom function and call in the footer value for Column.
    For reference, please refer to the attached sample.


    Also, could you please let us know your use case why you need to get Sum for a Column with String and Number type values combination and show in Footer row as a summary?


    PS: This uses the Data source hence the sum will not be updated on Editing the Spread View.

    ~Manish

    MultipleFieldsBinding.zip
  • Replied 6 February 2019, 9:28 am EST

    Thanks for the reply. The solution you provide only works for the first time grid populated, but our grid is an editable grid, when we change a cell in the column, the total value is not getting updated.

    The use case we have, as you can see from the image below, we have a debit column, the user can type a value into a cell or press a button, when the user press a button we will bring up another modal, and once modal is closed, we show a text 'source from cube' in the cell. That is why the debit column is mixed number and text. also the cell can be empty, and if the cell is empty, I notice the spreadview grid give the value as '', is also a string.

    So we are looking for a solution to display total number to sum up the cells has number and skip the cells has text in the column, and the total number will be updated whenever the cell in this column is edited.



  • Replied 10 February 2019, 7:42 pm EST

    Hi,
    Thanks for sharing the use-case with us and sorry for the inconvenience. We are unable to find a workaround for adding a summary with edit mode. We have forwarded your request to the concerned team for further investigation with internal id 269898.
    We will let you know as we get an update.

    ~Manish
  • Marked as Answer

    Replied 11 February 2019, 10:12 pm EST

    Hi,
    We got a response from the development team:
    The above feature has been added to the To-Do list and it may be implemented in future releases if found feasible.

    As a workaround, you should handle the editing event and update the DOM manually.

    Please refer to the attached sample for reference.

    Regards,
    Manish
    MultipleFieldsBinding-updated.zip
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels