Sum up a column in a dataset

I used this code below, but the problem is, the code computes all inside the column of a table.

$w.onReady(() => {
    Sum_amount();
});

export function Sum_amount() {
    wixData.aggregate("vipsubmission")
        .sum("distance", "sumamount")
        .run()
        .then((results) => {
            $w('#input1Sum').value = results.items[0].sumamount;
            console.log(results);
        });
}

I solve the problem on my own. Now it’s working fine by using this code below:

$w.onReady(() => {
    Sum_amount();
});

let filterA1 = wixData.filter().eq("fullName", "JP");

export function Sum_amount() {
    wixData.aggregate("vipsubmission")
        .filter(filterA1)
        .sum("distance", "sumamount")
        .run()
        .then((results) => {
 let items = results.items;
            $w('#input1Sum').value = results.items[0].sumamount;
            console.log(results);
        });
}