I have a table with 3 columns
Id, catagory and time in minutes
I have a repeat with a group on the catagory,
and this within the repeat Catagory: {{$key}} Number of Entries: {{$value.count()}}
is it possible to also output a sum for the time in minutes on the same line?
So for instance it would output the following (if all three time in minutes entries where 15 mins each)
Catagory : Walking Number of entries:3 Time in minutes: 45
Catagory : Running Number of entries:2 Time in minutes: 30
Thanks for the response bpj
unfortunatly the time in minutes field can be anything from 15mins upto 1440mins
Sorry I didnt make myself clear
so I need to count the number of entries and also sum time in minutes
Thanks again for your help i am still just learning
Im not sure if that will work as the time in minutes value is not always the same for a given category
The table would look something like this
id category time in minutes
1 Walking 15
2 Walking 30
3 Walking 45
4 Running 15
5 running 45
I need it to output in the repeat
Category : Walking Number of entries:3 Time in minutes: 90
Category : Running Number of entries:2 Time in minutes: 60
The last art of my previous post was slightly wrong. You don’t need the $value.count* as it is already doing a sum of the time in minutes. Your whole line would be like this:
Catagory: {{$key}} Number of Entries: {{$value.count()}} Time in minutes: {{serverconnectid.data.query.where('catagory',$key,'==').sum('time in minutes')}}
This worked (I had tried this previously and for some reason it didn't work, tried it again as per your suggestion and it works perfectly)
Thanks so much for all your help!!!