• Resolved andynz

    (@andynz)


    Hi Tobias
    I am probably trying to do something for which TablePress (brilliant as it) was never intended. So apologies!
    I have a table where Column A includes a value such as Auckland, Wellington, Dunedin. I use the column widget to display just the ‘Auckland’ entries, for example, and the message at the foot of the table shows the total number of matching rows.

    What I would really like to do is to have a row in which I display three counts for Auckland, Wellington and Dunedin. Something like =countif($A:$A,”=”,”auckland”). Is this possible without having to delve too deeply into things? Ideally, the summary would be in another table.

    Regards
    Andy

Viewing 1 replies (of 1 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    This is indeed a bit more complex ??

    If you want to do this based on the selection of the ColumnFilterWidgets, you’d have to use a JavaScript-based solution for the counting/calculations. The DataTables JS library, which the ColumnFilterWidgets is based on, does have a few event hooks that could be useful for that, but I have never really done that myself.

    Now, TablePress 2.0 (see the announcement and the download of the current test version at https://tablepress.org/8-million-downloads-tablepress-2-0/ ) will have a new formula calculation engine, which does included the COUNTIF function. I’m not sure about the $A:$A syntax for the cells right now though, so maybe you’d have to use A1:A100 or something there.

    Then, getting that into a different table…: I generally see two possibilities here.
    You could use the TablePress Extension from https://tablepress.org/extensions/table-cell-shortcode/ to get the cell content of a cell into a different table (or anywhere on the actually). However, that Shortcode normally only gets the raw/unevaluated cell content (in this case, the formula), but I remember posting a possible modification here in the forums so that it would return evaluated formula results.
    The other option, also with this Extension, and in addition the Extension https://tablepress.org/extensions/shortcodes-before-formulas/ would be to move the formula itself into the other table, and then replace the A1:A100 part with a bunch of [table-cell id=123 cell=A1 /],[table-cell id=123 cell=A2 /],[table-cell id=123 cell=A3 /], so that will be a bit tedious.

    Regards,
    Tobias

Viewing 1 replies (of 1 total)
  • The topic ‘Summarise tablepress entries’ is closed to new replies.