Summarising groups

Hi everyone, Can't reach to work summaries in Groups. Here is my code
->columns([
Tables\Columns\TextColumn::make('question.name'),
Tables\Columns\TextColumn::make('vote')
->numeric()
->summarize([
Average::make(),
Range::make(),
])
])
->defaultGroup('question.name')
//->groupsOnly()
->columns([
Tables\Columns\TextColumn::make('question.name'),
Tables\Columns\TextColumn::make('vote')
->numeric()
->summarize([
Average::make(),
Range::make(),
])
])
->defaultGroup('question.name')
//->groupsOnly()
I get only overall Summary, not each Group Summary. What's wrong? Thanks
No description
3 Replies
Arshavir
Arshavir4mo ago
Official Documentation says - "You can use summaries with groups to display a summary of the records inside a group. This works automatically if you choose to add a summariser to a column in a grouped table."
Arshavir
Arshavir4mo ago
I don't understand why, but count return 0
No description
Arshavir
Arshavir4mo ago
I noticed that query
select count(votes.vote) as "k5kOcH6JaOkVoM8r", avg(votes.vote) as "JIICJ8WvPk8rmn63", questions.name as "GPTSFikctaHh7g9H" from (select * from `votes` where `votes`.`votable_type` = 'App\Models\Lecturer' and `votes`.`votable_id` = 3 and `votes`.`votable_id` is not null and (`votes`.`deleted_at` is null)) as `votes` left join `questions` on `votes`.`question_id` = `questions`.`id` and `questions`.`deleted_at` is null group by `questions`.`name`
select count(votes.vote) as "k5kOcH6JaOkVoM8r", avg(votes.vote) as "JIICJ8WvPk8rmn63", questions.name as "GPTSFikctaHh7g9H" from (select * from `votes` where `votes`.`votable_type` = 'App\Models\Lecturer' and `votes`.`votable_id` = 3 and `votes`.`votable_id` is not null and (`votes`.`deleted_at` is null)) as `votes` left join `questions` on `votes`.`question_id` = `questions`.`id` and `questions`.`deleted_at` is null group by `questions`.`name`
no result
`votes`.`votable_type` = 'App\Models\Lecturer'
`votes`.`votable_type` = 'App\Models\Lecturer'
not working this clause
Want results from more Discord servers?
Add your server