Dynamic Annualized Number- Using Hard Coded Number Now for the Month

I have a beast mode that is currently using a hard coded number for the month (i.e 7 for July) and I want to make it dynamic to update each pervious month we close.  Below is my current beast mode, which works but is not dynamic:

 

(SUM(case when `Period`>='2019-01-01' and `Period`<'2020-01-01' and `Ledger Type`='AA' and `Suppress Plan Month`='No' then `Amount`  else 0 end)/7)*12

Best Answer

  • guitarhero23
    Accepted Answer
    (SUM(case when `Period`>='2019-01-01' and `Period`<'2020-01-01' and `Ledger Type`='AA' and `Suppress Plan Month`='No' then `Amount`  else 0 end)/MONTH(CURRENT_DATE()))*12

    Try doing this MONTH(CURRENT_DATE()) 

     

    Edit: Oh wait when you say previous month are you saying that this month being August (8) you want the report to be the month before aka /7 not 8, then in September you'd want /8.

     

    IF so use MONTH(DATE_SUB(CURDATE(), 1 month))

Answers