Huge Example file ▾Query

SELECT account, count(account) ORDER BY account
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 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
help
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 UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL#
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 UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL#
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 UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL#
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 UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL#
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 UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL#
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 UNION ALL SELECT NULL,NULL,NULL,NULL,NULL#
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 UNION ALL SELECT NULL,NULL,NULL,NULL#
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 UNION ALL SELECT NULL,NULL,NULL#
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 UNION ALL SELECT NULL,NULL#
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 UNION ALL SELECT NULL#
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 ORDER BY 1#
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%' UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL#
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%' UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL#
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%' UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL#
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%' UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL#
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%' UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL#