Monthly Income/Expense Reports

David G. Hamblen dhamblen at roadrunner.com
Tue Apr 5 06:35:39 EDT 2011


On 04/04/2011 10:36 AM, Derek Atkins wrote:
> David,
>
> "David G. Hamblen"<dhamblen at roadrunner.com>  writes:
>
>> I've ported the SQL code posted by markluser back on Jul 20 2009 (you
>> should be able to find the thread in the gnucash-user archives).  His
>> code was for Postgresql, I'm using mysql.  At this point I get a nice
>> Income Statement (aka P&L) by year (or month/day/microsecond)  as well
>> as Balance Sheets by year (or whatever increment I want).  The SQL
>> creates a "view", which can be opened using an OpenOffice Calc Data
>> Pilot (pivot table).
> What's wrong with the Income Statement and Balance Sheet reports that
> already exist within Gnucash (except for the fact that you can only run
> them on a per-day basis and not on a microsecond basis)?
Nothing wrong with the current reports, apart from the lack of a 
multiple-column option.  Indeed, those two gnucash reports are the ones 
I use most frequently, and the GC reports have multiple commodity 
options (average cost is the one I like, with no foreign currencies).  
I'm mostly interested in seeing if I could get the SQL queries working 
to export all my data to a spreadsheet, and those two reports provided a 
good sanity check to confirm that I had gotten the data into the 
spreadsheet correctly.  The other report that I use frequently is a 
Transaction report, for which I typical want to filter the data in 
various ways not easily available in the standard report.  (Silly 
example: "List all the postings on December 31 for all years?"  - I 
actually used this to get my "Closing Entries" for the past 10 years 
into a consistent state so that I could filter them with the standard P&L.).

The advantages are that I now have the data exported to a spreadsheet 
where I know how to generate custom reports, and I've learned a little 
SQL, without having to learn Scheme.

The disadvantages are that I could totally trash my data (backups, 
backups, backups), and, of course, manipulating the data outside of 
Gnucash itself is dangerous and officially frowned upon.  The internal 
database tables could change in ways that make my SQL code fail, perhaps 
disastrously.

Dave
>> Please remember to CC this list on all your replies.
>> You can do this by using Reply-To-List or Reply-All.
> -derek
>



More information about the gnucash-user mailing list