# 4/2/11 - PortfolioScript # Usage - mysql -u user -ppassword < PortfolioScript # based on https://lists.gnucash.org/pipermail/gnucash-user/2010-September/036424.html # this calls the SQL script which generates a table named "portfolio" within the gnucash-database # it has entries between two dates (slocal to elocal) with increment ulocal*ilocal # it needs to be manually executed every time the price or commodities tables are changed. # In OOCalc, create a pivot table from this database table # Column fields are level, mnemonic # Row field is ValueDate # Data field is value # All this is based on my chart of accounts which has investments in several accounts at level2: # specifically Assets/Taxable and Assets/Tax Deferred. Your level structure may differ. # # Next create a graph base on this pivot table. set @slocal := '2003-10-01'; #start date set @elocal := '2011-04-30'; #end date set @ilocal := 1; #increment set @ulocal := 'Month'; #increment unit source SQL/Portfolio-sql; call portfolio(@slocal, @elocal, @ilocal, @ulocal); #creates table portfolio