Hi Tiann,
Not having much look with this, i had a look at the link you posted and found the basis for the code but it is resulting as 0.
$w.onReady( function () {
//TODO: write your page related code here…
// no need to set the filter on the database since it’s still set
// how many items filtered in the dataset?
let count = $w(“#dataset1”).getTotalCount();
// get all of the items
$w(“#dataset1”).getItems(0, count)
.then((results) => {
let sumTotal = 0; // declare sum
let items = results.items;
items.forEach(item => {
// the amount is a string so convert
sumTotal = sumTotal + item.weekProfitLoss;
});
$w(“#text41”).text = “£439” + sumTotal;
}). catch ((err) => {
console.log(err);
});
});