Group By allows for consolidation of rows to make a single row.
, Sum([Capital] + [Interest]) As Amount
Group By TransactionID
I don’t really like “Group By” because it’s an aggregation that automatically hides some data. It can not easily be debugged. If there is a problem with some totals. The Group By needs to be theoretically or manually unravelled to find want it contains. This can be cumbersome. I find it better to have a staging area, where the aggregation is all grouped, and then totalled according to how I want it. That way, I can always just refer back to that table for any issues.