I don't see your current query?
Anyway, sounds like you just want to offset your end of last year calculations by one month. Which you can do by:
- Subtracting one month from the sysdate (add_months(dt, -1))
- Finding the start of the year this date is in (trunc(dt, 'y'))
- Subtracting one day (dt-1)
alter system set fixed_date = '2019-01-01';
select trunc ( add_months ( sysdate, -1 ), 'y' ) - 1
from dual;
TRUNC(ADD_MONTHS(SYSDATE,-1),'Y')-1
31-DEC-2017 00:00:00
alter system set fixed_date = '2019-02-02';
select trunc ( add_months ( sysdate, -1 ), 'y' ) - 1
from dual;
TRUNC(ADD_MONTHS(SYSDATE,-1),'Y')-1
31-DEC-2018 00:00:00
alter system set fixed_date = none;