• Resolved eiagnalt

    (@eiagnalt)


    Hi,
    I hope this isn’t answered in an other topic.

    I’m trying to sum a total after filtering, but get this error:
    “!ERROR! Cell E4 does not exist”

    my code is:

    $current_user = wp_get_current_user();

    tablepress_print_table( array(
    ‘id’ => ‘1’,
    ‘shortcodes_before_formulas’ => true,
    ‘hide_columns’ => ‘1’,
    ‘filter’ => $current_user->user_login
    ) );

    and in table one E1 I have : =SUM(E2:E[table-info id=1 field=”number_rows” /])

    thanks
    EinarA

    https://www.ads-software.com/extend/plugins/tablepress/

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

    (@tobiasbg)

    Hi,

    thanks for your question.

    The problem here might be the filtering.

    [table-info id=1 field="number_rows" /]

    will return the number of rows of the unfiltered table, so that after filtering the resulting table most likely has fewer rows than that number.
    Could that be possible?

    To further understand this, I’d like to see your tables, if possible.
    Could you maybe post a link, or send me the info on how to see the tables via email (the address is in the main plugin file “tablepress.php”)?

    Regards,
    Tobias

    Thread Starter eiagnalt

    (@eiagnalt)

    Hi,
    I printed “number_rows” and it’s returning the original number of rows, not the filtered, so yes I think that might be the problem. And if I don’t user any filters, the sum works perfect.

    Is it a way to count the filtered number of rows?

    thanks,
    Einar

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    ok, thanks for testing this!

    Unfortunately, I can’t really think of a possibility here ??
    The best chance I see is to create a custom Extension that, based on the Filtering Extension, calculates the number of rows of the filtered table, and then returns that with a Shortcode…

    Regards,
    Tobias

    Hi Tobias,

    Thank you for the great tool and extensive support here in the forum!

    Any news regarding this filter-sum issue? Having exactly the same problem like eiagnalt.

    Would be awesome!

    Best ragards
    Schmalitz

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post.

    No, sorry, no news here ?? I still have not found a nice way of making the number of filtered rows available here ??

    Regards,
    Tobias

    Hi Tobias,

    Sorry for annyoing with this. I’ve seen the 1.2 version and was wondering if this function maybe has been added?

    Thank you very much!

    Best regards,
    Schmalitz

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no, sorry. I have not made progress on this in the last two weeks.
    Once I do find a solution, I would add it to the changelog of the plugin update, so that I can be seen easily.

    Regards,
    Tobias

    Hi Tobias,

    First, good luck with your PhD!

    Sorry for bothering but may I ask if my above topic has been solved in the meantime? I have seen the php extension which potentially could do the job. I’m not sure if this extension already excisted when I initially posted my query here. I also checked the changelog without final answers.

    Now – as my php skills are quite weak I just wanted to check if there now maybe is an easy way before getting started…

    Thank you very much in advance!

    Greetz from Hamburg
    Schmalitz

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for the wishes!

    Unfortunately, I couldn’t find a solution here, yet. Sorry. The idea that I had for implementing this won’t work, as the formulas are evaluated before the filtering is performed.
    I’ll try to investigate if I can make the [table-info] Shortcode do the filtering as well, but I can’t promising anything here.

    Regards,
    Tobias

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Sum to "number_rows" with filters’ is closed to new replies.