ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Sum of numeric entries on a table

March 13, 2012 5:25pm

Subscribe [3]
  • #1 / Mar 13, 2012 5:25pm

    paolome

    75 posts

    I created a simple table with custom fields.
    How can I have at the end of the table a numeric value calculating sum results of numeric entries on a single column?

    <html>
    <head>
    <style type=“text/css”>
    table, td, th
    {
    border:1px solid green;
    }
    th
    {
    background-color:green;
    color:white;
    }
    </style>
    </head>

    <body>
    <table>
    <tr>
    <th>Socio</th>
    <th>Data</th>
    <th>Causale</th>
    <th>Descrizione</th>
    <th>rif.</th>
    <th>conto</th>
    <th>importo</th>
    </tr>
    {exp:channel:entries channel="movimenti" search:ragione_sociale="danny" dynamic=“no”}
    <tr>
    <td>{ragione_sociale}</td>
    <td>{data_reg}</td>
    <td>{causale}</td>
    <td>{descrizione}</td>
    <td>{rif_documento}</td>
    <td>{conto}</td>
    <td>{importo}</td>
    </tr>
    {/exp:channel:entries}

    </table>
    </body>
    </html>

     

  • #2 / Mar 14, 2012 3:41pm

    Shane Eckert

    7174 posts

    Hello,

    Thank you for posting your question.

    It sounds like you would like to display the total of certain rows. I think that would best be accomplished with the Query Module and a custom query to get your result.

    If you would like I can move this post over to the Community Help Forum and see if there are some ideas floating around there.

    Let me know your thoughts.

    Cheers,

  • #3 / Mar 15, 2012 2:38am

    paolome

    75 posts

    Ok, thanks. Let’s move the post. I’m really in the dark with Query Module. :red:

  • #4 / Mar 16, 2012 1:47pm

    Shane Eckert

    7174 posts

    Hello paolome,

    Will do!

    Cheers,

  • #5 / Mar 16, 2012 2:44pm

    Bhashkar Yadav

    727 posts

    Hi paolome,

    For it, you should use PHP into EE template.

  • #6 / Mar 16, 2012 8:08pm

    John St-Amand

    865 posts

    There’s a few simple math add-ons on devot-ee.com that will do much of the PHP for you without having to get into that yourself.  For many you just have to have the ability to feed the string of values you want summed into the plugin tags. If you’re pulling the numerical values from EE custom fields, you should be able to do that pretty easily.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases