Huge Example file ▾Query

SELECT account, count(account) ORDER BY account
SELECT Assets:US:BofA:Checking,     units(sum(position)) as units,     cost_number as cost,     first(getprice(currency, cost_currency)) as price,     cost(sum(position)) as book_value,     value(sum(position)) as market_value,     cost_date as acquisition_date   WHERE account_sortkey(account) ~ "^[01]"   GROUP BY account, cost_date, currency, cost_currency, cost_number, account_sortkey(account)   ORDER BY account_sortkey(account), currency, cost_date
SELECT account,     units(sum(position)) as units,     cost_number as cost,     first(getprice(currency, cost_currency)) as price,     cost(sum(position)) as book_value,     value(sum(position)) as market_value,     cost_date as acquisition_date   WHERE account_sortkey(account) ~ "^[01]"   GROUP BY account, cost_date, currency, cost_currency, cost_number, account_sortkey(account)   ORDER BY account_sortkey(account), currency, cost_date
SELECT     units(sum(position)) as units,     SAFEDIV(number(only(first(cost_currency), cost(sum(position)))), number(only(first(currency), units(sum(position))))) as average_cost,     cost(sum(position)) as book_value,     value(sum(position)) as market_value   WHERE account_sortkey(account) ~ "^[01]"   GROUP BY currency, cost_currency   ORDER BY currency, cost_currency
SELECT     units(sum(position)) as units,     cost(sum(position)) as book_value,     value(sum(position)) as market_value   WHERE account_sortkey(account) ~ "^[01]"   GROUP BY cost_currency   ORDER BY cost_currency
SELECT account,     units(sum(position)) as units,     cost(sum(position)) as book_value,     value(sum(position)) as market_value   WHERE account_sortkey(account) ~ "^[01]"   GROUP BY account, cost_currency, account_sortkey(account), currency   ORDER BY account_sortkey(account), currency
select account, date
SELECT account,     units(sum(position)) as units,     cost_number as cost,     first(getprice(currency, cost_currency)) as price,     cost(sum(position)) as book_value,     value(sum(position)) as market_value,     cost_date as acquisition_date   WHERE account_sortkey(account) ~ "^[01]"   GROUP BY account, cost_date, currency, cost_currency, cost_number, account_sortkey(account)   ORDER BY account_sortkey(account)
help
'help'
select account, count(account) order by account