sirs
i have dbf with
nqtyp nqtys nqtyn nqtyd nqtyfuel month ndcms ndchsd
321000 5000 4000 302000 632000 4 125291.1 84931.46
279000 15000 4000 258000 556000 5 113141.66 72557.34
289000 10000 10000 263000 572000 6 117318.03 73963.49
the nqtyfuel is total of nqtyp+nqtys+nqtyd+nqtyn for respective months
i have written
DO case
CASE nqtyfuel<400000.000
replace ALL ndcms WITH (nqtyp+nqtys+nqtyn)/1000*379.67 , ndchsd WITH nqtyd/1000*281.23
CASE nqtyfuel<600000.000
replace ALL ndcms WITH (nqtyp+nqtys+nqtyn)/1000*340.19,ndchsd WITH nqtyd/1000*251.99
CASE nqtyfuel<800000.000
replace ALL ndcms WITH (nqtyp+nqtys+nqtyn)/1000*300.72,ndchsd WITH nqtyd/1000*222.75
otherwise
replace ALL ndcms WITH (nqtyp+nqtys+nqtyn)/1000*261.24,ndchsd WITH nqtyd/1000*193.51
ENDCASE
sirs can you please tell me what is wrong in this do case command
because according to calculations for month 4 as
nqtyfuel is >600000 ndcms should be 321000+5000+4000=(330000/1000)*300.72=99237.60 and ndchsd as (302000/1000)*222.75=67270.5
for month5 as nqtyfuel=556000 it should be as
ndcms =279000+15000+4000=(298000/1000)*340.19 =101376.62 and ndchsd as (258000/1000)*251.99=65013.42 and so on
what is error in my do case please as i am getting the figures as shown above
i want to put values accordingly in ndcms and ndchsd
forgive for writting replace all
thanks
regards
i have dbf with
nqtyp nqtys nqtyn nqtyd nqtyfuel month ndcms ndchsd
321000 5000 4000 302000 632000 4 125291.1 84931.46
279000 15000 4000 258000 556000 5 113141.66 72557.34
289000 10000 10000 263000 572000 6 117318.03 73963.49
the nqtyfuel is total of nqtyp+nqtys+nqtyd+nqtyn for respective months
i have written
DO case
CASE nqtyfuel<400000.000
replace ALL ndcms WITH (nqtyp+nqtys+nqtyn)/1000*379.67 , ndchsd WITH nqtyd/1000*281.23
CASE nqtyfuel<600000.000
replace ALL ndcms WITH (nqtyp+nqtys+nqtyn)/1000*340.19,ndchsd WITH nqtyd/1000*251.99
CASE nqtyfuel<800000.000
replace ALL ndcms WITH (nqtyp+nqtys+nqtyn)/1000*300.72,ndchsd WITH nqtyd/1000*222.75
otherwise
replace ALL ndcms WITH (nqtyp+nqtys+nqtyn)/1000*261.24,ndchsd WITH nqtyd/1000*193.51
ENDCASE
sirs can you please tell me what is wrong in this do case command
because according to calculations for month 4 as
nqtyfuel is >600000 ndcms should be 321000+5000+4000=(330000/1000)*300.72=99237.60 and ndchsd as (302000/1000)*222.75=67270.5
for month5 as nqtyfuel=556000 it should be as
ndcms =279000+15000+4000=(298000/1000)*340.19 =101376.62 and ndchsd as (258000/1000)*251.99=65013.42 and so on
what is error in my do case please as i am getting the figures as shown above
i want to put values accordingly in ndcms and ndchsd
forgive for writting replace all
thanks
regards