I tried to add a view like that to bean-web, but didn't get that far.
#!/usr/bin/env python
import pandas as pd
import numpy as np
import os
import datetime
pd.options.display.max_rows = 100
pd.options.display.max_columns = 100
pd.options.display.width = 300
pd.options.display.float_format = '{:,.0f}'.format
try:
os.remove('ledger.csv')
except:
pass
bashcommand = "bean-query /home/david/.beancount/dave.beancount 'Select date, account, number where account ~ \"^Expenses:\"' | sed 2d | perl -pe 's/^ *| *$//g' | perl -pe 's/ +/,/g' > ledger.csv"
os.system(bashcommand)
df = pd.read_csv('ledger.csv',parse_dates=True)
df.date = df.date.str.slice(0,7)
df.index = df.date
grouped = df.ix['2014':,:].groupby(['account', 'date']).sum().number
pivot = grouped.unstack().fillna(0)
pivot.replace(0,np.nan).to_csv('monthly.csv')
#Aggregates first 2 levels
summary_index = [":".join(name.split(':')[0:2]) for name in pivot.index] #
summary = pivot
summary.index = summary_index
summary = summary.reset_index().groupby('index').sum()