Counting how often an ID is listed

Hi Folks. I’m trying to count how many times each center_id is listed in my query. In my repeater I have each center listed once. I want how many times it’s listed to be be in the same row. My query below counts all results and puts that same number in all rows. Any help is appreciated.

wixData.query( ‘training_progrss’ )
.include( ‘center_id’ )
.contains( ‘trainer’ , $w( “Staff” ).value)
.lt( ‘training_date’ , $w( ‘#toDate’ ).value)
.gt( ‘training_date’ , $w( ‘#fromDate’ ).value)
.find()
.then((results) => {
let items = results.items;

        $w( '#centersRepeater' ).data = items; 
        $w( "#centersRepeater" ).onItemReady(($item, itemData) => { 

            $item( "#centerTrainings" ).text =  ''  +results.totalCount // this just shows 7 for all 
            console.log(itemData.center_id.title); 
        }) 
    }) 

}

Still looking for help if anyone has any ideas…

Check first the results —> let items = results.items;

console.log(items)

Look what you get in console. Look at the structure.

Some practise with —> “include” see here…
https://russian-dima.wixsite.com/meinewebsite/how2-include