sir panu ko po macoconvert to =FORECAST(25,O6:Z6,O$3:Z$3) as query
View attachment 307562
eto po ung sample query ko
--LR
select avg(x)*25 from (
select s.partno, SUM(s.LR_X)as X,sum(LR_Y * 1)as y from (
select xf.partno,xf.LR_Y,LR_X= ROW_NUMBER() over (order by xf.LR_Y)
from (
select value as LR_Y,partno
from (
select *
from (
select partno,month13,month14,month15,month16,month17,month18,month19,month20,month21,month22,month23,month24
from #Forecast_total where partno='00232 CH200' )t
unpivot (
value for n in(month13,month14,month15,month16,month17,month18,month19,month20,month21,month22,month23,month24 ))p
)x
)xf
)s
group by s.partno
)x
thank you po
View attachment 307562
eto po ung sample query ko
--LR
select avg(x)*25 from (
select s.partno, SUM(s.LR_X)as X,sum(LR_Y * 1)as y from (
select xf.partno,xf.LR_Y,LR_X= ROW_NUMBER() over (order by xf.LR_Y)
from (
select value as LR_Y,partno
from (
select *
from (
select partno,month13,month14,month15,month16,month17,month18,month19,month20,month21,month22,month23,month24
from #Forecast_total where partno='00232 CH200' )t
unpivot (
value for n in(month13,month14,month15,month16,month17,month18,month19,month20,month21,month22,month23,month24 ))p
)x
)xf
)s
group by s.partno
)x
thank you po