• Resolved createline

    (@createline)


    Hi Tobias,

    Tablepress 2.0 is a really great plugin – Thank you

    Can you help me using formula sum – when the table is filtered the sum shows the same result over all lines?

    Is it possible to display only the sum of the filtered value?

    Thank you


Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Can you clarify this a little bit more, maybe with an example table? And what exact filtering mechanism do you use?

    Regards,
    Tobias

    Thread Starter createline

    (@createline)

    Hi Tobias,

    I have a soccer results page and I want to display the number of goals.

    The formula sum(F2:F829)

    When someone selects a season or Player the footer should only show the number of goals for that season. Currently, the total number of goals is always displayed.

    It would also be nice if only the number of goals per side would be displayed.

    https://www.vfb.createline.de/statistiken/statistik-profi-mannschaft/#Torj?ger_Saison_Profi

    Thank you

    • This reply was modified 2 years, 3 months ago by createline.
    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for the link and the explanation!

    That will not be possible with using a formula like that in the table, I’m afraid, as the formula is evaluated on the server (before the rendered table is sent to the browser), whereas the filtering dropdowns only work with JavaScript on the client side (in the browser).

    You would therefore need to use a JavaScript approach here. One idea could be to use the footerCallback feature of the DataTables JS library in some custom code (which could be inserted into the “Custom Commands” text field on the table’s “Edit” screen. These links could be a good starting point for such code: https://datatables.net/reference/option/footerCallback and https://datatables.net/examples/advanced_init/footer_callback

    Regards,
    Tobias

    Thread Starter createline

    (@createline)

    Thank you for your answer – I will try it on this way.

    Merry Christmas

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Formula Sum with filter’ is closed to new replies.