Unless you need a specific format (IE a CSV file with specific headers) I would do this as a report rather than an automation script. Then you could schedule the report weekly if you wanted or run it as needed. Most of what you're looking for can be done via the ad-hoc report functionality, but the summary of balances is a bit trickier because of how it handles the expressions (it joins the table instead of executes a subquery which requires the other columns to be part of a group by to be included). You still could use the QBR to build most of the report and then export the report to modify it and add the summary for balances. For example, I did a quick mockup in our 7.6 demo system.

------------------------------
Steven Shull
Naviam
------------------------------