ltannous
21st March 2003, 20:32
I am trying to get the cummulative values of a purchase schedule.
This will be based upon the user entering the first requirement week to be displayed. How can I get the cummulative requirements to show in this format:
If the requirements were 50 pcs per week.
WK1 WK2 WK3 WK4 WK5 WK6
50 50 50 50 50 (net req.)
100 150 200 250 300 350 (cum req.)
I tried to sum up the values, but no luck. This is what I have so far.
after.tdpsc006.seqn.2:
before.layout:
week1 = week.f
week2 = week1 + 1
week3 = week2 + 1
week4 = week3 + 1
week5 = week4 + 1
week6 = week5 + 1
week7 = week6 + 1
week8 = week7 + 1
week9 = week8 + 1
week10 = week9 + 1
week11 = week10 + 1
week12 = week11 +1
week13 = week12 + 1
week14 = week13 + 1
select tdpsc006.*, tdpsc005.*
from tdpsc006, tdpsc005
where tdpsc006.item = :tdpsc006.item
and tdpsc006.cont = :tdpsc006.cont
and tdpsc006.pono = :tdpsc006.pono
and tdpsc006.suno = :tdpsc006.suno
and tdpsc006.seqn = :tdpsc006.seqn
and tdpsc005.item = :tdpsc006.item
and tdpsc005.suno = :tdpsc006.suno
and tdpsc005.seqn = :tdpsc006.seqn
and tdpsc005.pono = :tdpsc006.pono
and tdpsc005.cont = :tdpsc006.cont
selectdo
if tdpsc006.week < week1 then
select sum(tdpsc006.totq)
from tdpsc006
where tdpsc006.item = tdpsc006.item
and tdpsc006.seqn = :tdpsc006.seqn
and tdpsc006.cont = :tdpsc006.cont
and tdpsc006.pono = :tdpsc006.pono
and tdpsc006.suno = :tdpsc006.suno
selectdo
begcum = tdpsc006.totq
endselect
endif
if tdpsc006.week = week1 then
qnty1 =tdpsc006.totq+ begcum
endif
if tdpsc006.week = week2 then
qnty2 = tdpsc006.totq+qnty1
endif
This will be based upon the user entering the first requirement week to be displayed. How can I get the cummulative requirements to show in this format:
If the requirements were 50 pcs per week.
WK1 WK2 WK3 WK4 WK5 WK6
50 50 50 50 50 (net req.)
100 150 200 250 300 350 (cum req.)
I tried to sum up the values, but no luck. This is what I have so far.
after.tdpsc006.seqn.2:
before.layout:
week1 = week.f
week2 = week1 + 1
week3 = week2 + 1
week4 = week3 + 1
week5 = week4 + 1
week6 = week5 + 1
week7 = week6 + 1
week8 = week7 + 1
week9 = week8 + 1
week10 = week9 + 1
week11 = week10 + 1
week12 = week11 +1
week13 = week12 + 1
week14 = week13 + 1
select tdpsc006.*, tdpsc005.*
from tdpsc006, tdpsc005
where tdpsc006.item = :tdpsc006.item
and tdpsc006.cont = :tdpsc006.cont
and tdpsc006.pono = :tdpsc006.pono
and tdpsc006.suno = :tdpsc006.suno
and tdpsc006.seqn = :tdpsc006.seqn
and tdpsc005.item = :tdpsc006.item
and tdpsc005.suno = :tdpsc006.suno
and tdpsc005.seqn = :tdpsc006.seqn
and tdpsc005.pono = :tdpsc006.pono
and tdpsc005.cont = :tdpsc006.cont
selectdo
if tdpsc006.week < week1 then
select sum(tdpsc006.totq)
from tdpsc006
where tdpsc006.item = tdpsc006.item
and tdpsc006.seqn = :tdpsc006.seqn
and tdpsc006.cont = :tdpsc006.cont
and tdpsc006.pono = :tdpsc006.pono
and tdpsc006.suno = :tdpsc006.suno
selectdo
begcum = tdpsc006.totq
endselect
endif
if tdpsc006.week = week1 then
qnty1 =tdpsc006.totq+ begcum
endif
if tdpsc006.week = week2 then
qnty2 = tdpsc006.totq+qnty1
endif