For our Sugar instance I created a Transactions Module which holds the monthly volume by customer. The Module is setup per each Account in columns by month and year. This way we can look by customer at just 2019 or just 2020 volume or each months individual transaction volume. I am looking for a formula to calculate the Last Full Year to Date volume up to previous full month (Jan to Aug 2019 if currently in Sep 2020) from the Accounts Module (LFY to Date) Volume. I am providing the formulas I currently use as a guide. Any help is appreciated.
I have a formula which calculates current YTD volume in Transactions Module:
add($january,$february,$march,$april,$may,$june,$july,$august,$september,$october,$november,$december)
This is the formula that calculates the current YTD volume in Accounts Module:
rollupConditionalSum($fbsg_transactions_accounts,"ytd_volume_c","yr","2020")
This is the formula that calculates the current LFY volume in Accounts Module:
rollupConditionalSum($fbsg_transactions_accounts,"ytd_volume_c","yr","2019")
I leverage this formula to calculate LFM volume from Accounts Module:
ifElse(equal(monthofyear(today()),1),rollupConditionalSum($fbsg_transactions_accounts,"december","yr","2019"),
ifElse(equal(monthofyear(today()),2),rollupConditionalSum($fbsg_transactions_accounts,"january","yr","2020"),
ifElse(equal(monthofyear(today()),3),rollupConditionalSum($fbsg_transactions_accounts,"february","yr","2020"),
ifElse(equal(monthofyear(today()),4),rollupConditionalSum($fbsg_transactions_accounts,"march","yr","2020"),
ifElse(equal(monthofyear(today()),5),rollupConditionalSum($fbsg_transactions_accounts,"april","yr","2020"),
ifElse(equal(monthofyear(today()),6),rollupConditionalSum($fbsg_transactions_accounts,"may","yr","2020"),
ifElse(equal(monthofyear(today()),7),rollupConditionalSum($fbsg_transactions_accounts,"june","yr","2020"),
ifElse(equal(monthofyear(today()),8),rollupConditionalSum($fbsg_transactions_accounts,"july","yr","2020"),
ifElse(equal(monthofyear(today()),9),rollupConditionalSum($fbsg_transactions_accounts,"august","yr","2020"),
ifElse(equal(monthofyear(today()),10),rollupConditionalSum($fbsg_transactions_accounts,"september","yr","2020"),
ifElse(equal(monthofyear(today()),11),rollupConditionalSum($fbsg_transactions_accounts,"october","yr","2020"),
ifElse(equal(monthofyear(today()),12),rollupConditionalSum($fbsg_transactions_accounts,"november","yr","2020"),
rollupConditionalSum($fbsg_transactions_accounts,"december","yr","2020")))))))))))))