Try using Interval Match. look for the examples on comunity. or else the same can be done using if else condition if you have less number of categories.
To use aggr function, you need to have grouping functions like sum, avg etc... tp get the right result. in your case, there is no need to use aggr function as youre just comparing with the bets. if you want to compare with the total amount of bet, then you need to calculate the sum of the bet amount first and then apply if else condition or interval match.
Note: you cannot perform aggr on direct load. you need to first load data and then perform aggr on resident load.