TABLE FILE PSA_WBKPMDP
SUM
COMPUTE V_TGT_STR_ADJ_HR_Q/P20C = IF TGT_STR_ADJ_HR_Q NE 0 THEN TGT_STR_ADJ_HR_Q ELSE 0; AS ' ,Store,Adjusted,Hours'
COMPUTE V_STRADJHRS_NA/A3 = IF V_TGT_STR_ADJ_HR_Q EQ 0 THEN 'n/a' ELSE '' ; AS ''
FOR
TIME_MEMBER
RECAP MTH = 0;AS '&V_MNTH_YEAR' OVER
'&V_WK1' LABEL R1 AS '&V_LABEL_WK1' OVER
'&V_WK2' LABEL R2 AS '&V_LABEL_WK2' OVER
'&V_WK3' LABEL R3 AS '&V_LABEL_WK3' OVER
'&V_WK4' LABEL R4 AS '&V_LABEL_WK4' OVER
RECAP MTH/P20C = R1+R2+R3+R4;
MTH(1)/P20C = IF R4(2) EQ 0 THEN 0 ELSE IF R3(2) EQ 0 THEN 0 ELSE IF R2(2) EQ 0 THEN 0 ELSE IF R1(2) EQ 0 THEN 0 ELSE ELSE R4(2)+R3(2)+R2(2)+R1(2)) ;
MTH(2)/A3 = IF MTH(1) EQ 0 THEN 'n/a' ELSE '' ;
END
In the above example, though MTH(1) is being calculated and dispalyed correctly, while calculating MTH(2), MTH(1) is always zero.Irrespective of the value of MTH(1), MTH(2) is always being set to the value 'n/a'.
What is the datatype of MTH(1) so that MTH(2) can be obtained correctly.
Using WF 7.1.7/Dev Studio