JasonKaufman
Programmer
I am wanting to create a report that will look at the last 3 months of sales. The data is held in an array.
I want the end user to be able to select the 1st month and the year for that starting month.
My problem is how do I deal with a month selection of either January or February as the previous month(s) will be in a prior year.
I currently have the two formulas below which work well as long as January or February are not selected.
Month1 =
((local stringvar array x;
x:=split({oe_hist_prod.units-shipped}, ";");
tonumber(x[{?Month 1}]) -
(local stringvar array x;
x:=split({oe_hist_prod.units-returned-nrstkd}, ";");
tonumber(x[{?Month 1}]) -
(local stringvar array x;
x:=split({oe_hist_prod.units-returned-rstkd}, ";");
tonumber(x[{?Month 1}]))
Month2 =
((local stringvar array x;
x:=split({oe_hist_prod.units-shipped}, ";");
tonumber(x[{?Month 1}-1]) -
(local stringvar array x;
x:=split({oe_hist_prod.units-returned-nrstkd}, ";");
tonumber(x[{?Month 1}-1]) -
(local stringvar array x;
x:=split({oe_hist_prod.units-returned-rstkd}, ";");
tonumber(x[{?Month 1}-1]))
Month3 is similar @ x[{?Month 1}-2]
I am unsure how to incorporate the month & year selection into either the formulas directly or indirectly through other formulas.
Thanks for any help that can be offered.
I want the end user to be able to select the 1st month and the year for that starting month.
My problem is how do I deal with a month selection of either January or February as the previous month(s) will be in a prior year.
I currently have the two formulas below which work well as long as January or February are not selected.
Month1 =
((local stringvar array x;
x:=split({oe_hist_prod.units-shipped}, ";");
tonumber(x[{?Month 1}]) -
(local stringvar array x;
x:=split({oe_hist_prod.units-returned-nrstkd}, ";");
tonumber(x[{?Month 1}]) -
(local stringvar array x;
x:=split({oe_hist_prod.units-returned-rstkd}, ";");
tonumber(x[{?Month 1}]))
Month2 =
((local stringvar array x;
x:=split({oe_hist_prod.units-shipped}, ";");
tonumber(x[{?Month 1}-1]) -
(local stringvar array x;
x:=split({oe_hist_prod.units-returned-nrstkd}, ";");
tonumber(x[{?Month 1}-1]) -
(local stringvar array x;
x:=split({oe_hist_prod.units-returned-rstkd}, ";");
tonumber(x[{?Month 1}-1]))
Month3 is similar @ x[{?Month 1}-2]
I am unsure how to incorporate the month & year selection into either the formulas directly or indirectly through other formulas.
Thanks for any help that can be offered.