Hi. I need to know if is there any alternative to group rows with SUM if a filter is applied.
I.E.: lets say we have a student with several courses.... on dates 10/10/2022, 10/11/2022, 10/12/2022 10/13/2022 and 11/01/2022.
with the date filter applied from 10/01/2022 to 10/30/2022, it should show only one row with SUM=4 instead of four rows with value=1 each..
You will see the screenshoot. It shows a table with four rows, each with value=1 or 2. But I wish to show only one row, with SUM of each column. maybe only one row with value=5 in total.
If one column of your table contains similar values for many rows, it often makes sense to use it as a “group column”. This means it will not be displayed as a column, but its values will be used to group the rows. Each group will be marked with one row with joined cells above containing the group value.
In the example screenshot, the ‘group’ is the exam name, which is based on the information in the second column (which is hidden when you enable grouping).
Row Grouping is only available for non-server side tables,
which are tables connected to data source, or SQL Tables with server-side processing disabled.
I just made a table example with some students.
If we use a student name as Row Grouping, it is going to look like this :
If we try Row Grouping on column "ausente" while filtering only student Cecilia, it will look like this :
So, you can not combine SUM from two columns and add them up together.
Basically, an important limitation of Calculation functions, is if you place a SUM for a column - this is only going to calculate the Total for that particular column.
-
The only way how you can combine values from multiple columns in a calculation is by making a Formula based Column, but you can not use "SUM" in a Formula.
There are several important limitations when using formula columns in wpDataTables:
One formula column cannot be used in another. This limitation can be avoided by using nested calculations.
In tables with server-side processing formula, columns cannot be used for grouping, filtering, and sorting. Basically, formulas are calculated only for the rows that are immediately visible; Therefore, it’s not possible to “know” the values for currently invisible rows. Please note that this also applies to the “Manual” tables, as they also use server-side processing by default. Also, of course, it is not possible to edit the cells generated by formulas in the editable tables.
Adding a sum in the sum row for formula columns is not yet supported.
to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there, and as more people vote, the feature will move higher on the priority list.
You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;
and our newsletter, so you're informed about new features, bug fixes, freebies, etc.
Hi. I need to know if is there any alternative to group rows with SUM if a filter is applied.
I.E.: lets say we have a student with several courses.... on dates 10/10/2022, 10/11/2022, 10/12/2022 10/13/2022 and 11/01/2022.
with the date filter applied from 10/01/2022 to 10/30/2022, it should show only one row with SUM=4 instead of four rows with value=1 each..
You will see the screenshoot. It shows a table with four rows, each with value=1 or 2. But I wish to show only one row, with SUM of each column. maybe only one row with value=5 in total.
Hi, Adrian
Thanks for reaching out to us
-
I am sorry to disappoint you, but something like what you described is not possible to achieve with the current plugin's capabilities.
- First we will explain the logic behind our Row Grouping option.
If one column of your table contains similar values for many rows, it often makes sense to use it as a “group column”. This means it will not be displayed as a column, but its values will be used to group the rows. Each group will be marked with one row with joined cells above containing the group value.
In the example screenshot, the ‘group’ is the exam name, which is based on the information in the second column (which is hidden when you enable grouping).
Row Grouping is only available for non-server side tables,
which are tables connected to data source, or SQL Tables with server-side processing disabled.
I just made a table example with some students.
If we use a student name as Row Grouping, it is going to look like this :
If we try Row Grouping on column "ausente" while filtering only student Cecilia, it will look like this :
So, you can not combine SUM from two columns and add them up together.
Basically, an important limitation of Calculation functions, is if you place a SUM for a column - this is only going to calculate the Total for that particular column.
-
The only way how you can combine values from multiple columns in a calculation is by making a Formula based Column, but you can not use "SUM" in a Formula.
There are several important limitations when using formula columns in wpDataTables:
-
Let me know if this makes sense and if you have any questions.
If you wish to add any suggestion for our developers about future improvements,
Please feel free to search on our suggestions page,
to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there, and as more people vote, the feature will move higher on the priority list.
You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;
and our newsletter, so you're informed about new features, bug fixes, freebies, etc.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables