Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have written the below formula :
If(Sum(Consumption) <> 0,Only({<MonthYear={">=$(=Date(AddMonths(Max(MonthYear), -96)))<=$(=Date(Max(MonthYear)))"}>} Aggr(
RangeSum(Above(Sum({<MonthYear={">=$(=Date(AddMonths(Max(MonthYear), -96)))<=$(=Date(Max(MonthYear)))"}
>} Consumption), 0, Month(Only({<MonthYear={">=$(=Date(AddMonths(Max(MonthYear), -96)))<=$(=Date(Max(MonthYear)))"}>} Month))))
, cat, (MonthYear, (NUMERIC)))))
But every time i don't want to change that 96(those many months(7 years) i have). Because next month i have to change to 97 then next month 98...
I don't want it to be hard coding.
Can you please help me how it to be automated.
Please let me know if you need anything more.
Thanks,
Bharat
If that is the case... then why don't you just use this
MonthYear = {">=$(=Date(MakeDate(2012)))<=$(=Date(Max(MonthYear)))"}>}
Because the beginning will always be Jan 2012... then why do you even need to do -96, -97,... and so on?
Try this
Sum({<MonthYear={">=$(=Date(Min(MonthYear)))<=$(=Date(Max(MonthYear)))"}, Consumption = {"*"}>} Aggr(RangeSum(Above(Sum({<MonthYear>} IB), 0, Month(Only({<MonthYear>} Month)))), cat, (MonthYear, (NUMERIC))))/ Sum(TOTAL <[Month-Year]>{<MonthYear={">=$(=Date(Min(MonthYear)))<=$(=Date(Max(MonthYear)))"}, Consumption = {"*"}>} Aggr(RangeSum(Above(Sum({<MonthYear>} IB), 0, Month(Only({<MonthYear>} Month)))), cat, (MonthYear, (NUMERIC))))
So it seems that the lower limit is fixed at a certain date? Will it always be fixed there? meaning with each passing month you will keep on increasing the number? 96, 97, 98, .... 110, ...., 120, ....150... etc? or does it every reset?
But next year will the number is 96 + 12 = 108 and then then year after it will be 96 + 24 = 120?
Right but what will happen a year from now
Jan2019 - 97
Feb2019 - 98
Mar2019 - 99
Apr2019 - 100
May2019 - 101
Jun2019 - 102
July2019 - 103
Aug2019 - 104
Sep2019 - 105
Oct2019 - 106
Nov2019 - 107
Dec2019 - 108 or 96?
Jan2020 - 109 or 97?
Does my question may sense?
If that is the case... then why don't you just use this
MonthYear = {">=$(=Date(MakeDate(2012)))<=$(=Date(Max(MonthYear)))"}>}
Because the beginning will always be Jan 2012... then why do you even need to do -96, -97,... and so on?
I think so... may be just Min({1} MonthYear)