How to sum column value in bootstrap table

What am I doing wrong

<table class="table table-hover">
                <thead>
                    <tr>
                        <th>Name</th>
                        <th>Email</th>
                        <th>Field</th>
                    </tr>
                </thead>
                <tbody is="dmx-repeat" dmx-generator="bs5table" dmx-bind:repeat="sc_get_clients.data.qry_clients" id="tableRepeat5">
                    <tr tabindex="0" dmx-on:contextmenu="notifies_main.info('context menus')">
                        <td dmx-text="name"></td>
                        <td dmx-text="email"></td>
                        <td dmx-text="field_id"></td>
                    </tr>
                </tbody>
                <tfoot>
                    <tr>
                        <td colspan="3">Total Reach Number: {{tableRepeat5.items.sum('$value.Field.toNumber()')}}</td>
                    </tr>
                </tfoot>

            </table>

This expression should be:

{{tableRepeat5.items.sum('Field')}}

if your database returns a field called Field

1 Like

Great thanks Teodor,

Works perfectly with a more complex table with computed values.
Chat gpt believes that the sum function uses the column name...

Don't rely too much on what chatgpt provides as code :slight_smile:

Yeh very true, it's getting much better, it has generally saved me a lot of time but it does hallucinate in a very convincing manner.