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.
DEFINE FILE FINALREPORT
CHECK_ITEM_DATE/YYMD = DATECVT(CHECK_ITEM_DATE,'MDYY','YYMD');
DaysToPay/D6 = IF CHECK_ITEM_DATE EQ '' THEN 0 ELSE CHECK_ITEM_DATE - INVOICE_DATE;
DaysToPay2/A20 = IF CHECK_ITEM_DATE EQ '' THEN 'OPEN PAYABLE' ELSE FTOA(DaysToPay,'(D6)', DaysToPay2);
DaysInOpenAP/D6 = IF CHECK_ITEM_DATE EQ '' THEN 0 ELSE CHECK_ITEM_DATE - YYMDGLDate;
DaysInOpenAP2/A20 = IF CHECK_ITEM_DATE EQ '' THEN 'OPEN PAYABLE' ELSE FTOA(DaysInOpenAP,'(D6)', DaysInOpenAP2);
LATE/A11 = IF CHECK_ITEM_DATE NE '' AND CHECK_ITEM_DATE LT DUE_DATE THEN 'YES' ELSE IF CHECK_ITEM_DATE NE '' AND CHECK_ITEM_DATE GT DUE_DATE THEN 'NO' ELSE IF CHECK_ITEM_DATE EQ '' THEN 'OPEN';
END
TABLE FILE FINALREPORT
PRINT
VENDOR_NUMBER
ALPHA_NAME
PAYMENT_TERMS
INVOICE_NUMBER
AMOUNT
PAYMENT_ITEM_NUMBER
INVOICE_DATE
YYMDScanDate
YYMDGLDate
DUE_DATE
CHECK_ITEM_DATE
DaysToReceive
DaysToApprove
DaysInOpenAP
DaysInOpenAP2
LATE
BY VENDOR_NUMBER NOPRINT
ON TABLE PCHOLD FORMAT EXL2K
I need to display the Average of: DaysToReceive DaysToApprove DaysInOpenAP DaysInOpenAP2
under their column. How can I accomplish that?
Thanks,This message has been edited. Last edited by: kpiracha,
This automatically means that the average applies to an input row and so is equal the value.
Basically 1 / 1 = 1.
Multi-verb request is required
TABLE FILE FINALREPORT
SUM
COMPUTE AVG_AMT/D20.2= AMOUNT / CNT.INVOICE_NUMBER;
BY VENDOR_NUMBER
BY ALPHA_NAME
PRINT
AMOUNT
PAYMENT_ITEM_NUMBER
INVOICE_DATE
YYMDScanDate
YYMDGLDate
DUE_DATE
CHECK_ITEM_DATE
DaysToReceive
DaysToApprove
DaysInOpenAP
DaysInOpenAP2
LATE
BY VENDOR_NUMBER
BY ALPHA_NAME
BY PAYMENT_TERMS
BY INVOICE_NUMBER
END
Thanks for all your help guys. I tried both options but because of the DEFINE DaysToPay2/A20 = IF CHECK_ITEM_DATE EQ '' THEN 'OPEN PAYABLE' ELSE FTOA(DaysToPay,'(D6)', DaysToPay2);
The averages were not showing up correctly. If I did AVE. DaysToPay2, it will just show as blank. If I used DaysToPay for the avg, it will give the average based on the number of rows. For eg:
If DaysToPay column as the following: 26 30 0 0 0 0
Then the average was 26+30\6 because there were 6 rows. This was not the right average for our purpose since we wanted to ignore the blank or 0s.
I had to update the code as follows:
DEFINE FILE FINALREPORT
CHECK_ITEM_DATE/YYMD = DATECVT(CHECK_ITEM_DATE,'MDYY','YYMD');
DaysToPay/D6 = CHECK_ITEM_DATE - INVOICE_DATE;
DaysToPay2/A20 = IF CHECK_ITEM_DATE EQ '' THEN 'OPEN PAYABLE' ELSE FTOA(DaysToPay,'(D6)', DaysToPay2);
DaysInOpenAP/D6S = CHECK_ITEM_DATE - YYMDGLDate;
DaysInOpenAP2/A20 = IF CHECK_ITEM_DATE EQ '' THEN 'OPEN PAYABLE' ELSE FTOA(DaysInOpenAP,'(D6)', DaysInOpenAP2);
LATE/A11 = IF CHECK_ITEM_DATE NE '' AND CHECK_ITEM_DATE LT DUE_DATE THEN 'YES' ELSE IF CHECK_ITEM_DATE NE '' AND CHECK_ITEM_DATE GT DUE_DATE THEN 'NO' ELSE IF CHECK_ITEM_DATE EQ '' THEN 'OPEN';
TOAVG/D10 MISSING ON= IF DaysToPay LE 0 THEN MISSING ELSE DaysToPay;
TOAVG2/D10 MISSING ON= IF DaysInOpenAP LE 0 THEN MISSING ELSE DaysInOpenAP;
END
TABLE FILE FINALREPORT
SUM AVE.DaysToReceive NOPRINT
AVE.DaysToApprove NOPRINT
AVE.TOAVG NOPRINT
AVE.TOAVG2 NOPRINT
BY VENDOR NOPRINT
PRINT
VENDOR_NUMBER
ALPHA_NAME
PAYMENT_TERMS
INVOICE_NUMBER
AMOUNT
PAYMENT_ITEM_NUMBER
INVOICE_DATE
YYMDScanDate
YYMDGLDate
DUE_DATE
CHECK_ITEM_DATE
DaysToReceive
DaysToApprove
DaysToPay2
DaysInOpenAP2
LATE
BY VENDOR_NUMBER NOPRINT
-*ON TABLE SUBTOTAL AVE. DaysToReceive AVE. DaysToApprove AVE. DaysToPay2 AVE. DaysInOpenAP2
ON VENDOR_NUMBER SUBFOOT
"Average Days - Receive,Approve,Pay & Open AP<AVE.DaysToReceive<AVE.DaysToApprove<AVE.TOAVG<AVE.TOAVG2"
ON TABLE PCHOLD FORMAT EXL2K
and then used the stylesheet modification to move the amount under the right column.