As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I have a report that is calling several fex files. This report calculates percentages for current vs prior periods. Can some one explain following code since my percentage calculation is not being done correctly.
-*INCLUDE 00_SETTING.FEX
-*------------------------------------------------------------------------------
-* Periods: Current and Prior Periods
DEFINE FILE WKRVAGG0
TG/A7 = EDIT(FYPW,'999999');
CP/A2 = IF TG EQ '&FYP_0' THEN 'CP' ELSE 'PP';
AMOUNT1/P15.2 = IF LITM1 EQ 'Enrollments' THEN AMOUNTW ELSE AMOUNT;
AMOUNT2/P15.2 = 0;
COLENT/A10 = TG | ' ';
END
TABLE FILE WKRVAGG0
SUM
AMOUNT1
AMOUNT2
SOURCE
BY BURST
BY UNIT1
BY UNIT2
BY LITM1
BY LITM2
BY LITM3
BY CP
BY TG
BY COLENT
WHERE
TG EQ '&FYP_0'
OR TG EQ '&FYP_1'
OR TG EQ '&FYP_2'
OR TG EQ '&FYP_3'
ON TABLE HOLD AS WKRVAGG1 FORMAT FOCUS
END
?FF WKRVAGG1
-RUN
-*------------------------------------------------------------------------------
-* Periods: Calculate the change from Prior Year Period to Current Year Period.
DEFINE FILE WKRVAGG0
PER/A2 = EDIT(FYPW,'$$$$99');
CP/A2 = IF PER EQ '&P_0' THEN 'CP' ELSE
IF PER EQ '&P_1' THEN 'PP' ELSE '*';
TG/A7 = IF PER EQ '&P_0' THEN '&FYP_0' ELSE
IF PER EQ '&P_1' THEN '&FYP_1' ELSE '*';
AMOUNTX/P15.2 = IF LITM1 EQ 'Enrollments' THEN AMOUNTW ELSE AMOUNT;
AMOUNT1/P15.2 = IF EDIT(FYPW,'999999') NE '&FYP_12' OR '&FYP_13' THEN AMOUNTX ELSE 0;
AMOUNT2/P15.2 = IF EDIT(FYPW,'999999') EQ '&FYP_12' OR '&FYP_13' THEN AMOUNTX ELSE 0;
COLENT/A10 = TG | 'Ch';
END
TABLE FILE WKRVAGG0
SUM
AMOUNT1
AMOUNT2
SOURCE
BY BURST
BY UNIT1
BY UNIT2
BY PER NOPRINT
BY LITM1
BY LITM2
BY LITM3
BY CP
BY TG
BY COLENT
WHERE
EDIT(FYPW,'999999') EQ '&FYP_0'
OR EDIT(FYPW,'999999') EQ '&FYP_1'
OR EDIT(FYPW,'999999') EQ '&FYP_12'
OR EDIT(FYPW,'999999') EQ '&FYP_13'
ON TABLE HOLD AS WKRVAGG2 FORMAT FOCUS
END
?FF WKRVAGG2
-RUN
-*------------------------------------------------
-* Weeks: Current Periods
DEFINE FILE WKRVAGG0
CP/A2 = 'CP';
-*TG/A9 = EDIT(FYPW,'999999999');
TG/A7 = EDIT(FYPW,'9999999');
AMOUNT1/P15.2 = AMOUNT;
AMOUNT2/P15.2 = AMOUNT;
COLENT/A10 = TG | ' ';
END
TABLE FILE WKRVAGG0
SUM
AMOUNT1
AMOUNT2
SOURCE
BY BURST
BY UNIT1
BY UNIT2
BY LITM1
BY LITM2
BY LITM3
BY CP
BY TG
BY COLENT
WHERE EDIT(FYPW,'999999') EQ '&FYP_0'
ON TABLE HOLD AS WKRVAGG3 FORMAT FOCUS
END
?FF WKRVAGG3
-RUN
-*---------------------------------------------------------------------------------------------
-* Weeks: Calculate the change from Prior Year Period's Weeks to Current Year Period's Weeks.
-SET &LYPW = &FYP_12 | &W_0 ;
DEFINE FILE WKRVAGG0
CP/A2 = 'CP';
TG/A7 = '&FYPW_0';
AMOUNT1/P15.2 = IF FYPW EQ '&FYPW_0' THEN AMOUNT ELSE 0;
AMOUNT2/P15.2 = IF FYPW NE '&FYPW_0' THEN AMOUNT ELSE 0;
COLENT/A10 = TG | 'Ch';
END
TABLE FILE WKRVAGG0
SUM
AMOUNT1
AMOUNT2
SOURCE
BY BURST
BY UNIT1
BY UNIT2
BY LITM1
BY LITM2
BY LITM3
BY CP
BY TG
BY COLENT
WHERE FYPW EQ '&FYPW_0' OR '&LYPW'
ON TABLE HOLD AS WKRVAGG4 FORMAT FOCUS
END
?FF WKRVAGG4
-RUN
-*------------------------------------------------
USE
WKRVAGG1 AS WKRVAGG1
WKRVAGG2 AS WKRVAGG1
WKRVAGG3 AS WKRVAGG1
WKRVAGG4 AS WKRVAGG1
END
-*------------------------------------------------
-* Calculate % Columns
DEFINE FILE WKRVAGG1
AMOUNT1A/P15.2 = AMOUNT1;
AMOUNT1B/P15.2 = AMOUNT1;
AMOUNT1C/P15.2 = AMOUNT1;
AMOUNT2A/P15.2 = AMOUNT2;
AMOUNT2B/P15.2 = AMOUNT2;
AMOUNT2C/P15.2 = AMOUNT2;
END
TABLE FILE WKRVAGG1
SUM
AMOUNT1C
AMOUNT2C
BY BURST
BY UNIT1
BY UNIT2
BY CP
BY TG
BY COLENT
BY LITM1
SUM
AMOUNT1B
AMOUNT2B
BY BURST
BY UNIT1
BY UNIT2
BY CP
BY TG
BY COLENT
BY LITM1
BY LITM2
SUM
AMOUNT1A
AMOUNT2A
SOURCE
BY BURST
BY UNIT1
BY UNIT2
BY CP
BY TG
BY COLENT
BY LITM1
BY LITM2
BY LITM3
ON TABLE HOLD AS WKRVAGG5 FORMAT FOCUS
END
-RUN
?FF WKRVAGG5
-*------------------------------------------------
DEFINE FILE WKRVAGG5
COLENTP/A10 = TG | '%';
END
TABLE FILE WKRVAGG5
SUM
AMOUNT1A AS 'AMOUNT1'
AMOUNT1B AS 'AMOUNT2'
SOURCE
BY BURST
BY UNIT1
BY UNIT2
BY LITM1
BY LITM2
BY LITM3
BY CP
BY TG
BY COLENTP AS 'COLENT'
WHERE COLENT OMITS 'Ch'
ON TABLE HOLD AS WKRVAGG6 FORMAT FOCUS
END
?FF WKRVAGG6
-RUN
-*------------------------------------------------
DEFINE FILE WKRVAGG5
COLENTP/A10 = TG | '%';
LITEM3/A25 = ' ';
END
TABLE FILE WKRVAGG5
SUM
AMOUNT1B AS 'AMOUNT1'
AMOUNT1C AS 'AMOUNT2'
SOURCE
BY BURST
BY UNIT1
BY UNIT2
BY LITM1
BY LITM2
BY LITEM3 AS 'LITM3'
BY CP
BY TG
BY COLENTP AS 'COLENT'
WHERE COLENT OMITS 'Ch'
ON TABLE HOLD AS WKRVAGG7 FORMAT FOCUS
END
?FF WKRVAGG7
-RUN
-*------------------------------------------------
-* Subtotal Payor for all Programs.
DEFINE FILE WKRVAGG5
LITEM3/A25 = ' ';
AMOUNT2/P15.2 = IF COLENT CONTAINS 'Ch' THEN AMOUNT2B ELSE 0;
END
TABLE FILE WKRVAGG5
SUM
FST.AMOUNT1B AS 'AMOUNT1'
FST.AMOUNT2
SOURCE
BY BURST
BY UNIT1
BY UNIT2
BY LITM1
BY LITM2
BY LITEM3 AS 'LITM3'
BY CP
BY TG
BY COLENT
ON TABLE HOLD AS WKRVAGG8 FORMAT FOCUS
END
?FF WKRVAGG8
-RUN
-*------------------------------------------------
-* Subtotal Tuition,Registrations,etc. for all Payors.
DEFINE FILE WKRVAGG8
LITEM2/A25 = ' ';
LITEM3/A25 = ' ';
END
TABLE FILE WKRVAGG8
SUM
AMOUNT1
AMOUNT2
SOURCE
BY BURST
BY UNIT1
BY UNIT2
BY LITM1
BY LITEM2 AS 'LITM2'
BY LITEM3 AS 'LITM3'
BY CP
BY TG
BY COLENT
ON TABLE HOLD AS WKRVAGG9 FORMAT FOCUS
END
?FF WKRVAGG9
-RUN
-*
-SET &TIME=HHMMSS('A8');
-TYPE ********** Base Data Ready - Timestamp: &DATEYYMD &TIME
-*------------------------------------------------
USE CLEAR
USE
WKRVAGG1 AS WKRVAGG6
WKRVAGG2 AS WKRVAGG6
WKRVAGG3 AS WKRVAGG6
WKRVAGG4 AS WKRVAGG6
WKRVAGG6 AS WKRVAGG6
WKRVAGG7 AS WKRVAGG6
WKRVAGG8 AS WKRVAGG6
WKRVAGG9 AS WKRVAGG6
END
-RUN
-*------------------------------------------------
-* License Capacity
APP FI ENRLLICT DISK enrllict.txt (APPEND
DEFINE FILE DIM_SCHOOL
UNIT2/A25 = &UNIT2_FIELD;
END
TABLE FILE DIM_SCHOOL
SUM
LICENSECAPACITY
BY UNIT2
ON TABLE HOLD AS ENRLLICT FORMAT ALPHA
END
-RUN
?FF ENRLLICT
-RUN
-*-----------------------
-* Total License Capacity
DEFINE FILE DIM_SCHOOL
UNIT2/A25 = ' Total';
END
TABLE FILE DIM_SCHOOL
SUM
LICENSECAPACITY
BY UNIT2
ON TABLE HOLD AS ENRLLICT FORMAT ALPHA
END
-RUN
?FF ENRLLICT
!type ENRLLICT.MAS
-RUN
TABLE FILE ENRLLICT
SUM
LICENSECAPACITY
BY UNIT2
ON TABLE HOLD AS ENRLLICA FORMAT FOCUS INDEX UNIT2
END
-RUN
JOIN LEFT_OUTER UNIT2 IN WKRVAGG6 TO UNIQUE UNIT2 IN ENRLLICA
-RUN
-*
DEFINE FILE WKRVAGG6
LITEM1/A25 = 'License Capacity / %UE';
END
TABLE FILE WKRVAGG6
SUM
LICENSECAPACITY/P15.2 AS 'AMOUNT1'
AMOUNT1 AS 'AMOUNT2'
SOURCE
BY BURST
BY UNIT1
BY UNIT2
BY LITEM1 AS 'LITM1'
BY LITM2
BY LITM3
BY CP
BY TG
BY COLENT
WHERE LITM1 EQ 'Enrollments' AND LITM2 EQ ' ' AND LITM3 EQ ' '
WHERE COLENT OMITS 'Ch'
ON TABLE HOLD AS ENRLAGGT FORMAT FOCUS
END
-*
DEFINE FILE WKRVAGG6
LITEM1/A25 = 'License Capacity / %UE';
COLENTP/A10 = TG | '%';
END
TABLE FILE WKRVAGG6
SUM
LICENSECAPACITY/P15.2 AS 'AMOUNT1'
AMOUNT1 AS 'AMOUNT2'
SOURCE
BY BURST
BY UNIT1
BY UNIT2
BY LITEM1 AS 'LITM1'
BY LITM2
BY LITM3
BY CP
BY TG
BY COLENTP AS 'COLENT'
WHERE LITM1 EQ 'Enrollments' AND LITM2 EQ ' ' AND LITM3 EQ ' '
WHERE COLENT OMITS 'Ch'
ON TABLE HOLD AS ENRLAGGP FORMAT FOCUS
END
JOIN CLEAR *
-RUN
This message has been edited. Last edited by: Kerry,
Thanks for looking into it. I guess I dont understand the % calculation. I dont see any calculation being done here. I see % symbol is being concatinated with the field value. However, I need to have calculated information here As following
-* I need this calculation (Number/Total)/100 | '%'
[quote]-* Calculate % Columns
DEFINE FILE WKRVAGG1
AMOUNT1A/P15.2 = AMOUNT1;
AMOUNT1B/P15.2 = AMOUNT1;
AMOUNT1C/P15.2 = AMOUNT1;
AMOUNT2A/P15.2 = AMOUNT2;
AMOUNT2B/P15.2 = AMOUNT2;
AMOUNT2C/P15.2 = AMOUNT2;
END
TABLE FILE WKRVAGG1
SUM
AMOUNT1C
AMOUNT2C
BY BURST
BY UNIT1
BY UNIT2
BY CP
BY TG
BY COLENT
BY LITM1
SUM
AMOUNT1B
AMOUNT2B
BY BURST
BY UNIT1
BY UNIT2
BY CP
BY TG
BY COLENT
BY LITM1
BY LITM2
SUM
AMOUNT1A
AMOUNT2A
SOURCE
BY BURST
BY UNIT1
BY UNIT2
BY CP
BY TG
BY COLENT
BY LITM1
BY LITM2
BY LITM3
ON TABLE HOLD AS WKRVAGG5 FORMAT FOCUS
END
-RUN
?FF WKRVAGG5
-*------------------------------------------------
DEFINE FILE WKRVAGG5
COLENTP/A10 = TG | '%';
END
TABLE FILE WKRVAGG5
SUM
AMOUNT1A AS 'AMOUNT1'
AMOUNT1B AS 'AMOUNT2'
SOURCE
BY BURST
BY UNIT1
BY UNIT2
BY LITM1
BY LITM2
BY LITM3
BY CP
BY TG
BY COLENTP AS 'COLENT'
WHERE COLENT OMITS 'Ch'
ON TABLE HOLD AS WKRVAGG6 FORMAT FOCUS
END
?FF WKRVAGG6
-RUN
-*------------------------------------------------
DEFINE FILE WKRVAGG5
COLENTP/A10 = TG | '%';
LITEM3/A25 = ' ';
END
TABLE FILE WKRVAGG5
SUM
AMOUNT1B AS 'AMOUNT1'
AMOUNT1C AS 'AMOUNT2'
SOURCE
BY BURST
BY UNIT1
BY UNIT2
BY LITM1
BY LITM2
BY LITEM3 AS 'LITM3'
BY CP
BY TG
BY COLENTP AS 'COLENT'
WHERE COLENT OMITS 'Ch'
ON TABLE HOLD AS WKRVAGG7 FORMAT FOCUS
END
?FF WKRVAGG7
-RUN[/quote]
There is no calculation being done. That either suggests that the code is not complete or that the % calculation that you are looking for is actually being done in the procedure/process that loads your source data.
'TG' is obtained directly from 'WKRVAGG1'. So any calculation is that is to be done.
And looking in the code of your first post. TG is in the first DEFINE being the value EDIT(FYPW,'999999'); So it's the same as FYPW except converted to numeric.
Try to find out what FYPW comes from...
g'luck.
_____________________ WF: 8.0.0.9 > going 8.2.0.5
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010
So following is the code where temp table being built. However its not doing % calculations for change vs prior %:
-*INCLUDE 00_setting.fex
-*
JOIN
DIM_TIME_KEY IN AGG_ENROLLMENT TO UNIQUE
DIM_TIME_KEY IN DIM_TIME TAG J0 AS J0
END
JOIN
DIM_PAYORTYPE_KEY IN AGG_ENROLLMENT TO UNIQUE
DIM_PAYORTYPE_KEY IN DIM_PAYORTYPE TAG J1 AS J1
END
JOIN
DIM_PROGRAM_KEY IN AGG_ENROLLMENT TO UNIQUE
DIM_PROGRAM_KEY IN DIM_PROGRAM TAG J2 AS J2
END
JOIN
DIM_SCHOOL_KEY IN AGG_ENROLLMENT TO UNIQUE
DIM_SCHOOL_KEY IN DIM_SCHOOL TAG J3 AS J3
END
-*
-SET &TIME=HHMMSS('A8');
-TYPE ********** Enrollment Start Data Pull - Timestamp: &DATEYYMD &TIME
-*
DEFINE FILE AGG_ENROLLMENT
CORP/A25 = 'Corp.';
UPBRAND/A3 = UPCASE(3,BRAND,'A3');
LITM2/A25 = EDIT(PAYORTYPE,'9999999999999999999999999') ;
LITM3/A25 = EDIT(DIM_PROGRAM.GROUPER1,'9999999999999999999999999');
END
-*
TABLE FILE AGG_ENROLLMENT
SUM
&UNIT1_FIELD/A25 AS 'UNIT1'
&UNIT2_FIELD/A25 AS 'UNIT2'
-* Computing Enrollments
-* COMPUTE NEWSUM/D12.2 = AGG_ENROLLMENT.AGG_ENROLLMENT.ENROLLEDACTIVE + AGG_ENROLLMENT.AGG_ENROLLMENT.ENROLLEDUNSCHEDULED; AS 'ENROLLED'
-*Enrollment Code Change for Last Week
COMPUTE NEWSUM2/D12.2 =
-* IF FYP EQ '&FYP_0' THEN ENROLLEDACTIVE + ENROLLEDUNSCHEDULED ELSE IF (EDIT(FYPW,'999999') NE '&FYP_0') AND
-* (EDIT(FYPW,'$$$$99$') EQ '03' OR '06' OR '09' OR '12') AND (EDIT(FYPW,'$$$$$$9') EQ '5') THEN ENROLLEDACTIVE + ENROLLEDUNSCHEDULED
-* ELSE IF (EDIT(FYPW,'999999') NE '&FYP_0') AND (EDIT(FYPW,'$$$$99$') EQ '01' OR '02' OR '04' OR '05' OR '07' OR '08' OR '10' OR '11') AND
-* EDIT(FYPW,'$$$$$$9') EQ '4'
-* THEN ENROLLEDACTIVE + ENROLLEDUNSCHEDULED ELSE 0; AS 'ENROLLED'
-*COMPUTE NEWSUM2/D12.2 =
IF FYP EQ '&FYP_0'
-* AND (EDIT(FYPW,'$$$$$$9') EQ '1' OR '2' OR '3' OR '4' OR '5'
THEN ENROLLEDACTIVE + ENROLLEDUNSCHEDULED ELSE IF ( (EDIT(FYPW,'$$$$99$') EQ '03' OR '06' OR '09' OR '12') AND (EDIT(FYPW,'$$$$$$9') EQ '5') )
THEN ENROLLEDACTIVE + ENROLLEDUNSCHEDULED
ELSE IF (EDIT(FYPW,'$$$$99$') EQ '01' OR '02' OR '04' OR '05' OR '07' OR '08' OR '10' OR '11') AND EDIT(FYPW,'$$$$$$9') EQ '4'
THEN ENROLLEDACTIVE + ENROLLEDUNSCHEDULED ELSE 0; AS 'ENROLLED'
-*End Code change for Lsat Week
EnrolledUnscheduled AS 'UNSCHED'
NewEnroll AS 'NEWENROLL'
Withdraw AS 'WITHDRAW'
&BURST
BY FYPW
BY LITM2
BY LITM3
BY &UNIT1_FIELD NOPRINT
BY &UNIT2_FIELD NOPRINT
WHERE &UNIT1_WHFIELD EQ '&UNIT1_VAL'
WHERE FYPW LE '&FYPW_0'
WHERE FYP EQ '&FYP_0'
OR FYPW EQ '&FYPW_1'
OR FYPW EQ '&FYPW_2'
OR FYPW EQ '&FYPW_3'
OR FYPW EQ '&FYPW_12'
OR FYPW EQ '&FYPW_13'
ON TABLE HOLD AS ENRLAGGX FORMAT FOCUS
END
?FF ENRLAGGX
-RUN
-*
-SET &TIME=HHMMSS('A8');
-*---------------------------------------------------
-* Enrollments (Active)
DEFINE FILE ENRLAGGX
LITM1/A25 = 'Enrollments';
AMOUNT/P15.2 = ENROLLED;
FYP/A6 = EDIT(FYPW,'999999');
END
TABLE FILE ENRLAGGX
SUM
LST.AMOUNT NOPRINT
&BURST
BY UNIT1
BY UNIT2
BY LITM1
BY LITM2
BY LITM3
BY FYP
SUM
&BURST
COMPUTE NEWWK/P15.2 = IF UNIT1 NE LAST UNIT1 OR UNIT2 NE LAST UNIT2 OR LITM1 NE LAST LITM1 OR LITM2 NE LAST LITM2 OR LITM3 NE LAST LITM3 OR FYP NE LAST FYP
THEN 1 ELSE 0; NOPRINT
AMOUNT
COMPUTE AMOUNTW/P15.2 = LST.AMOUNT * NEWWK;
BY UNIT1
BY UNIT2
BY LITM1
BY LITM2
BY LITM3
BY FYP NOPRINT
BY FYPW
ON TABLE HOLD AS ENRLAGGD FORMAT FOCUS
END
?FF ENRLAGGD
-RUN
!type enrlaggd.mas
-*
TABLE FILE ENRLAGGD
SUM
AMOUNT
AMOUNTW
&BURST
BY UNIT1
BY UNIT2
BY LITM1
BY LITM2
BY LITM3
BY FYPW
ON TABLE HOLD AS ENRLAGGE FORMAT FOCUS
END
?FF ENRLAGGE
-RUN
!type enrlagge.mas
-*---------------------------------------------------
-* Enrollments (Unscheduled)
DEFINE FILE ENRLAGGX
LITM1/A25 = 'Enrollments Unsched.';
AMOUNT/P15.2 = UNSCHED;
FYP/A6 = EDIT(FYPW,'999999');
END
TABLE FILE ENRLAGGX
SUM
LST.AMOUNT NOPRINT
&BURST
BY UNIT1
BY UNIT2
BY LITM1
BY LITM2
BY LITM3
BY FYP
SUM
&BURST
COMPUTE NEWWK/P15.2 = IF UNIT1 NE LAST UNIT1 OR UNIT2 NE LAST UNIT2 OR LITM1 NE LAST LITM1 OR LITM2 NE LAST LITM2 OR LITM3 NE LAST LITM3 OR FYP NE LAST FYP
THEN 1 ELSE 0; NOPRINT
AMOUNT
COMPUTE AMOUNTW/P15.2 = LST.AMOUNT * NEWWK;
BY UNIT1
BY UNIT2
BY LITM1
BY LITM2
BY LITM3
BY FYP NOPRINT
BY FYPW
ON TABLE HOLD AS ENRLAGGD FORMAT FOCUS
END
?FF ENRLAGGD
-RUN
!type enrlaggd.mas
-*
TABLE FILE ENRLAGGD
SUM
AMOUNT
AMOUNTW
&BURST
BY UNIT1
BY UNIT2
BY LITM1
BY LITM2
BY LITM3
BY FYPW
ON TABLE HOLD AS ENRLAGGU FORMAT FOCUS
END
?FF ENRLAGGU
-RUN
!type enrlaggu.mas
-*---------------------------------------------------
-* New Enrollments
DEFINE FILE ENRLAGGX
LITM1/A25 = 'New Enrollments';
AMOUNT/P15.2 = NEWENROLL;
AMOUNTW/P15.2 = 0;
END
TABLE FILE ENRLAGGX
SUM
AMOUNT
AMOUNTW
&BURST
BY UNIT1
BY UNIT2
BY LITM1
BY LITM2
BY LITM3
BY FYPW
ON TABLE HOLD AS ENRLAGGN FORMAT FOCUS
END
?FF ENRLAGGN
-RUN
!type enrlaggn.mas
-*---------------------------------------------------
DEFINE FILE ENRLAGGX
LITM1/A25 = 'Withdraws';
AMOUNT/P15.2 = WITHDRAW;
AMOUNTW/P15.2 = 0;
END
TABLE FILE ENRLAGGX
SUM
AMOUNT
AMOUNTW
&BURST
BY UNIT1
BY UNIT2
BY LITM1
BY LITM2
BY LITM3
BY FYPW
ON TABLE HOLD AS ENRLAGGW FORMAT FOCUS
END
?FF ENRLAGGW
-RUN
!type enrlaggw.mas
-*---------------------------------------------------
-* New Enrollments
DEFINE FILE ENRLAGGX
LITM1/A25 = 'Net Enrollments';
AMOUNT/P15.2 = NEWENROLL - WITHDRAW;
AMOUNTW/P15.2 = 0;
END
TABLE FILE ENRLAGGX
SUM
AMOUNT
AMOUNTW
&BURST
BY UNIT1
BY UNIT2
BY LITM1
BY LITM2
BY LITM3
BY FYPW
ON TABLE HOLD AS ENRLAGGT FORMAT FOCUS
END
?FF ENRLAGGT
-RUN
!type enrlaggt.mas
-*---------------------------------------------------
USE
ENRLAGGE AS ENRLAGGN
ENRLAGGU AS ENRLAGGN
ENRLAGGN AS ENRLAGGN
ENRLAGGW AS ENRLAGGN
ENRLAGGT AS ENRLAGGN
END
-RUN
-*---------------------------------------------------
DEFINE FILE ENRLAGGN
SOURCE/A4 = 'ENRL';
END
TABLE FILE ENRLAGGN
SUM
AMOUNT
AMOUNTW
SOURCE
&BURST
BY FYPW
BY LITM1
BY LITM2
BY LITM3
BY UNIT1
BY UNIT2
ON TABLE HOLD AS ENRLAGG0 FORMAT FOCUS
END
-RUN
?FF ENRLAGG0
!type enrlagg0.mas
-RUN
-SET &TIME=HHMMSS('A8');
-TYPE ********** Enrollment End Data Pull - Timestamp: &DATEYYMD &TIME
Hard to find exactly. The only thing I see that might be it ( a lot of code to check ).
This code checks the previous line against te current line.
COMPUTE NEWWK/P15.2 = IF UNIT1 NE LAST UNIT1 OR UNIT2 NE LAST UNIT2 OR LITM1 NE LAST LITM1 OR LITM2 NE LAST LITM2 OR LITM3 NE LAST LITM3 OR FYP NE LAST FYP THEN 1 ELSE 0; NOPRINT
So this seem to ( if last code returns 1 ) calculate the last amount × new-week.
For some reason I am confused now. That i tried to copy all the fex files to different domain and its giving me correct calculation there. I am not sure whats the problem. I am looking into it and working with IBI support. Thanks for all the help! Arif