Statistics

Page 1 of 1
2 posts
Statistics

Nikolay
MMEX Developer

Posts: 2282
Joined: Sat Dec 06, 2008 8:27 am
Location: Sankt-Petersburg, Russia
Code: Select all
select 'Cheching Accounts Open:' text, count (*) c from accountlist_v1 where accounttype='Checking' and status='Open'
union all
select 'Cheching Accounts Closed:' text, count (*) c from accountlist_v1 where accounttype='Checking' and status='Closed'
union all
select 'Cheching Accounts:' text, count (*) c from accountlist_v1 where accounttype='Checking'
union all
select 'Investment Accounts:' text, count (*) c from accountlist_v1 where accounttype='Investment'
union all
select 'Accounts Total:' text, count (*) c from accountlist_v1
union all
Select 'Bigest Transaction amount:', (max (TRANSamount)) from checkingaccount_v1
union all
Select 'Withdrawal Records:', count (*) from checkingaccount_v1 where transcode='Withdrawal'
union all
Select 'Deposit Records:', count (*) from checkingaccount_v1 where transcode='Deposit'
union all
Select 'Transfer Records:', count (*) from checkingaccount_v1 where transcode='Transfer'
union all
Select 'Splited Transactions:', count (distinct transid) from splittransactions_v1
union all
Select 'Financial Records:', count (*) from checkingaccount_v1
union all
Select 'Earliest transaction:', min (transdate) from checkingaccount_v1
union all
Select 'Categories:', count (*) from category_v1
union all
Select 'Categories used:', count (distinct (case ca.categid when -1 then st.categid else ca.categid end)) from checkingaccount_v1 ca
left join splittransactions_v1 st on ca.transid=st.transid
union all
Select 'Categories used last 12 month:', count (distinct (case ca.categid when -1 then st.categid else ca.categid end)) from checkingaccount_v1 ca
left join splittransactions_v1 st on ca.transid=st.transid where ca.transdate>=date('now','-12 month')
union all
Select 'Subcategories:', count (*) from subcategory_v1
union all
Select 'Subcategories used:', count (distinct (case ca.subcategid when -1 then st.subcategid else ca.categid end)) from checkingaccount_v1 ca
left join splittransactions_v1 st on ca.transid=st.transid
union all
Select 'Subcategories used last 12 month:', count (distinct (case ca.subcategid when -1 then st.subcategid else ca.categid end)) from checkingaccount_v1 ca
left join splittransactions_v1 st on ca.transid=st.transid where ca.transdate>=date('now','-12 month')
Re: Statistics

Nikolay
MMEX Developer

Posts: 2282
Joined: Sat Dec 06, 2008 8:27 am
Location: Sankt-Petersburg, Russia
UP
may be interesting as sample for new General Report Manager
Page 1 of 1
Who is online

Users browsing this forum: No registered users and 1 guest

cron