Group by date and summarize number of pages
I have a table that records each book read, the user, number of pages read and the date. I have used
summarize
for displaying the total number of pages read and also used ->defaultGroup
to group by month and year. This looks great, but the summarize result is not correct.
As you can see on Date: Dec 2020
the sum of pages shows 243
, which is not correct.1 Reply
I found a solution for my issue: The problem when grouping is that Filament expects an ID column when displaying the data in a table.
However, as we know, when we group rows according to a particular field, we don't need the ID of a row. To fix this, we need to create a new field ID that will be formed by the number of total grouped roles.
That can be done through SQL like this: