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.
What kind of calculations do you want to do? Can you do them in a define then set a display flag for the lines you want to show and test the flag in the table request?
The way the report is working is I calculate the days between the PURSHIP line and the SERLOTSWAP line. This gives me the 155 days. I need the SERLOTSWAP line to do this calculation, but I don't want to display it.
WebFocus 7703 Windows 7 Output format: HTML, Excel, PDF
Is PURSHIP one field...are those all fields? You can make a define that says IF FIELD EQ PURSHIP THEN FIELD ELSE ' '; Then use the define field in the report. Then make another define with calculations.
In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005
Do you only need PURSHIP and SERLOTSWAP? Are the pairs always present or could you have singles? Also, when you want to show some code or some data enclose then between the tags that you get by clicking on < / >
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006
Each set will always have at least one purship row and that is the one I want. Here is another example 410303 1 EX75193 CL4APW0078 06/14/2007 0 ARR-REPAIR 1 EX75193 CL4APW0078 06/14/2007 06/14/2007 0 INVM-IN 1 EX75193 CL4APW0078 06/14/2007 06/14/2007 0 SERLOTSWAP 1 EX75193 CL4APW0078 01/10/2007 06/14/2007 155 PURSHIP
The PURSHIP has the date from the LAST row (6/14/2007). The 01/10/2007 is from the actual PURSHIP row. When I create a field to only select the PURSHIP row I lose the 06/14/2007 record.
WebFocus 7703 Windows 7 Output format: HTML, Excel, PDF
Tracie, I'm sorry but your examples are not consistent. In the first there were no dates. In the second, each row has 2 dates except the first. At first you say you want to do calculations. Then you say that you need dates. Could you be somewhat more specific?
Do you need dates from both the PURSHIP and the SERLOTSWAP? Do you also want to calculate the difference between the values of the 2 records? Will there always be 2 records?
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006
Sorry, I am new at this. In the example the purship row has everything I need. All calculations are correct. What I want to do is surpress all lines except the purship one. When I attempt to do that, since I am calculating with data from second line, I lose that line. The 155 on the purship line is the difference between the 6/14/2007 on the SERLOTSWAP row and the 1/10/2007 on the purship row. The display of 6/14/2007 on the purship row is the date from the SERLOPSWAP row. When I attempt to surpress the other rows, I also lose the 6/14/2007 date that is tied to those other rows.
WebFocus 7703 Windows 7 Output format: HTML, Excel, PDF
Is what you are showing the output? If yes, can you show us the input records and then what you want in the output?
As I mentioned much earlier in this post, you can do your calculations on all of your rows in a DEFINE. Then in the DEFINE, set a flag to 1 if the line contains 'PURSHIP' and zero if it does not. Then test the flag in the TABLE part of your request and only print the rows where the flag is equal to 1. You can do this in a COMPUTE as well but you would need to test TOTAL FLAG.
Here is the source. The input looks like the report already posted. PRINT LINE_NO AS 'Line No.' PART_NO AS 'Part No' SERIAL_NO AS 'Serial No' DATED/HMDYY AS 'Date Send Out' newfield/HMDYY AS 'Date Returned' COMPUTE Daysout/D12 = HDIFF(newfield, DATED, 'DAY', 'D12.2'); AS 'Days at the Vendor' TRANSACTION_CODE BY ORDER_NO AS 'PO No.' Newfield is defined as LAST DATED The desired output is one row pur PO with the data that exists on the PURSHIP line. Thanks for your patience.
WebFocus 7703 Windows 7 Output format: HTML, Excel, PDF
You can do this in a COMPUTE as well but you would need to test TOTAL FLAG.
I don't know which field contains 'PURSHIP' but you can make the adjustment. Add this to your code:
PRINT
LINE_NO AS 'Line No.'
PART_NO AS 'Part No'
SERIAL_NO AS 'Serial No'
DATED/HMDYY AS 'Date Send Out'
newfield/HMDYY AS 'Date Returned'
COMPUTE Daysout/D12 = HDIFF(newfield, DATED, 'DAY', 'D12.2');
PURSHIP_FLAG/I1=IF FLD??? EQ 'PURSHIP' THEN 1 ELSE 0;
AS 'Days at the Vendor'
TRANSACTION_CODE
BY ORDER_NO AS 'PO No.'
WHERE TOTAL PURSHIP_FLAG EQ 1;
I added it and the report returns 0 rows. This is what has been happening regardless of what I try. PRINT LINE_NO AS 'Line No.' PART_NO AS 'Part No' SERIAL_NO AS 'Serial No' DATED/HMDYY AS 'Date Send Out' newfield/HMDYY AS 'Date Returned' COMPUTE Daysout/D12 = HDIFF(newfield, DATED, 'DAY', 'D12.2'); COMPUTE purship_flag/I1 = IF TRANSACTION_CODE EQ 'PURSHIP' THEN 1 EQ 0; AS 'Days at the Vendor' TRANSACTION_CODE BY ORDER_NO AS 'PO No.' ON TABLE SUBHEAD "" HEADING "Vendor TurnTime Report for: FOOTING "Run Date : <+0>&DATEtrMDYY <+0> " ON TABLE SUBFOOT " " "Page: WHERE ( VENDOR_NO EQ '&VENDOR_NO.Vendor No.' ) AND ( PART_NO LIKE 'EX%' ) AND ( STATE EQ 'Closed' ); WHERE ( DATE_ENTERED GE DT(&DATE_ENTERED.Begin Date.) ) AND ( DATE_ENTERED LE DT(&EndDate.End Date.) ); WHERE TOTAL purship_flag EQ 1;
WebFocus 7703 Windows 7 Output format: HTML, Excel, PDF
Tracie, When you copy code (or output) to the forum, first press on the button < / > and insert the code between the [ code ] flags.
I see that you have 2 WHERE statements. Could it be that they disrupt the data you are retrieving? If you take out the WHERE TOTAL do you get 'PURSHIP'?
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006
PRINT
COMPUTE purship_flag/I1 = IF TRANSACTION_CODE CONTAINS 'PURSHIP' THEN 1 EQ 0;
LINE_NO AS 'Line No.'
PART_NO AS 'Part No'
SERIAL_NO AS 'Serial No'
DATED/HMDYY AS 'Date Send Out'
newfield/HMDYY AS 'Date Returned'
COMPUTE Daysout/D12 = HDIFF(newfield, DATED, 'DAY', 'D12.2');
AS 'Days at the Vendor'
TRANSACTION_CODE
BY ORDER_NO AS 'PO No.'
WHERE ( VENDOR_NO EQ '&VENDOR_NO.Vendor No.' ) AND ( PART_NO LIKE 'EX%' ) AND ( STATE EQ 'Closed' ) AND ( TRANSACTION_CODE EQ 'PURSHIP' OR 'SERLOTSWAP' );
This is interesting. When I look for two types of transaction codes I get both of them. I am wondering since I need both rows to determine the daysout that maybe I need both to display? Thanks again.
WebFocus 7703 Windows 7 Output format: HTML, Excel, PDF
Since you are doing a PRINT, you can do your calculation in a DEFINE and test for the transaction code there. You will retrieve all the records but only do the calculation on the rows that you want by saying IF TRANSACTION_CODE EQ .... THEN HDIFF(...).
PRINT
LINE_NO AS 'Line No.'
PART_NO AS 'Part No'
SERIAL_NO AS 'Serial No'
DATED/HMDYY AS 'Date Send Out'
newfield/HMDYY AS 'Date Returned'
purshiprecs
COMPUTE purship_flag/I1 = IF TRANSACTION_CODE CONTAINS 'PURSHIP' THEN 1 ELSE 0;
BY ORDER_NO AS 'PO No.'
ON TABLE SUBHEAD
""
HEADING
"Vendor TurnTime Report for: <NAME - <VENDOR_NO "
FOOTING
"Run Date : <+0>&DATEtrMDYY <+0> "
ON TABLE SUBFOOT
" "
"Page: <TABLASTPAGE"
IF purship_flag EQ 1
WHERE ( VENDOR_NO EQ '&VENDOR_NO.Vendor No.' ) AND ( PART_NO LIKE 'EX%' ) AND ( STATE EQ 'Closed' );
WHERE ( DATE_ENTERED GE DT(&DATE_ENTERED.Begin Date.) ) AND ( DATE_ENTERED LE DT(&EndDate.End Date.) );
GOT IT. This is the source I ended up with. Thanks to all for all the help and patience.
WebFocus 7703 Windows 7 Output format: HTML, Excel, PDF