Issue getting results into table

I have a page with 2 tables; the first one shows individual results by being connected to a collection and the second one I would like to display an aggregate of the first table for a specific person, so it should only be one row. When I run my aggregation, nothing shows in the table. Here is my code:

import wixData from 'wix-data';
$w.onReady(() => {
    Sum_amount();
});

export function Sum_amount(){
    let currentItem = $w('#dynamicDataset').getCurrentItem();
    let currentmember = currentItem.memberid;
    let having = wixData.filter().eq("member",currentmember)
    
    wixData.aggregate("TxResults")
        .having(having)
        .sum("totalpts","totPts")
        .run()
        .then( (results) => {
            $w('#table2').rows = results.items;
        });
}

Hi,
if I understand correctly you are getting the value of having from default members database collection.
Aggregations can only be used on collections you have created. They cannot be used on Wix App Collections . Click here to learn more.
To make it work, you need to create a custom members’ database. Build your own member’s area. Click here to learn how.
If this is not the case or the issue persists, please get back with the link to the editor in question and the name of the page with the code so we can check further.

Thanks for the reply Aleks. The having part is from the members collection but my aggregate is actually running on the TxResults collection, so no calculations are being done on the members collection. Just the query for the filter