when using aggr function (SUM,MAX,COUNT..) you will need to use Group By a statement as well.
Sum(Field B) AS Sales
group by Field A,Field B
Then you will need to map this back to your final table.
so is better to load once a whole table and then perform your calculations.
I think there couldn't be a general answer - it will always depend on the concrete scenario if an aggregation on the script-level is more suitable then doing this within the gui and if a script-solution is needed how the real requirements are.
For example, by a small dataset you don't need to worry much about performance but already by mid-sized datasets it will make a difference if you need to include all fields with an anggregartion and/or if there needs to filter something with a where-clause - this meant the combination of where- and group by statements within a single load could be significant slower then separating them.
Therefore it will be depend ...