Hello,
this formula finds the best sales month from the last 12 months:
Dim MonthArray () as number
MonthArray = Array({CUSTHIS.SALEQTY00}, {CUSTHIS.SALEQTY01}, {CUSTHIS.SALEQTY02}, {CUSTHIS.SALEQTY03}, {CUSTHIS.SALEQTY04}, {CUSTHIS.SALEQTY05}, _
{CUSTHIS.SALEQTY06}, {CUSTHIS.SALEQTY07}, {CUSTHIS.SALEQTY08}, {CUSTHIS.SALEQTY09}, {CUSTHIS.SALEQTY10}, {CUSTHIS.SALEQTY11}, {CUSTHIS.SALEQTY12})
formula = maximum(MonthArray)
It returns the value: 302 , which is {CUSTHIS.SALEQTY11}
{CUSTHIS.SALEQTY11} is position 12 of 13 in the array.
What formula would I write to return this position?
the reason I want to do this,
SALEQTY00 is the current month (October), SALEQTY01 is last month (September), SALEQTY02 is last month -1 (August) and so on....
I need to identify which month it is and display that as the monthname in the report.
once I can identify the index of the best month, I can simply write a formula like:
etc...
Can anyone advise on the best way for me to achieve this?
Please?
Thanks.
Mike