Re: Monthly category report with selectable categories and time range?
Posted: Wed Apr 13, 2022 5:49 pm
those lines give me:
SQL logic error[1]: no such column: t1.STATUS
SQL logic error[1]: no such column: t1.STATUS
official forum for the Money Manager eX product
https://forum.moneymanagerex.org/
Code: Select all
-- TODO: Update category and subcategory name in line 19.
select strftime('%Y', t1.TRANSDATE) as YEAR
, strftime('%m', t1.TRANSDATE) as MONTH
, total(t1.TRANSAMOUNT * c1.BASECONVRATE)
+ (select total(split.SPLITTRANSAMOUNT * c2.BASECONVRATE) from CHECKINGACCOUNT_V1 as t2
inner join ACCOUNTLIST_V1 as a2 on a2.ACCOUNTID = t1.ACCOUNTID
inner join CURRENCYFORMATS_V1 as c2 on c2.CURRENCYID = a2.CURRENCYID
inner join SPLITTRANSACTIONS_V1 as split on t2.TRANSID = split.TRANSID
where strftime('%Y', t2.TRANSDATE) = strftime('%Y', t1.TRANSDATE)
and strftime('%m', t2.TRANSDATE) = strftime('%m', t1.TRANSDATE)
and split.CATEGID = cat.CATEGID
and split.SUBCATEGID = subcat.SUBCATEGID
and t2.STATUS <> 'V') as AMOUNT
from CHECKINGACCOUNT_V1 as t1
inner join ACCOUNTLIST_V1 as a1 on a1.ACCOUNTID = t1.ACCOUNTID
inner join CURRENCYFORMATS_V1 as c1 on c1.CURRENCYID = a1.CURRENCYID
inner join CATEGORY_V1 as cat on t1.CATEGID = cat.CATEGID
inner join SUBCATEGORY_V1 as subcat on t1.SUBCATEGID = subcat.SUBCATEGID
where cat.CATEGNAME = 'Haus' and subcat.SUBCATEGNAME = 'Garten'
and t1.STATUS <> 'V'
AND TRANSDATE >= '2018/01/01'
AND TRANSDATE <= '2020/12/31'
group by year, month
order by year asc, month asc;At the end of each month I want to see what our spending has been in category 'Food' subcat 'Grocery shopping' over 'Last 90 days' say, so that I can see how we've done against previous months.dbolton wrote: Fri Apr 29, 2022 1:56 am Out of curiosity, what do you use the period selection for? I tend to pick "Over Time" and not change it after that.
I'm trying to easily read each month's values. A table showing each month's value would help, or annotation on the chart itself. Yes - I'd expect data only for the cat/sub-cat I've selected. The average value (plus a line on the graph!) would be helpful.dbolton wrote: Fri Apr 29, 2022 1:56 amAlso it would be helpful to understand how you would use the data table. The chart does show the exact numbers if you hover. Are you looking for a table that matches the category you select and shows the same data as the chart (plus maybe the averages)?