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 need a report that locates duplicate records in which four fields are the same. If a record contains the same values in f3,f4,f5 and f6 Then print the ENTIRE Record (24 fields). With something incase no records are found (the desired response):
IF COUNT EQ 0 Print "No Duplicates Found"
TABLE FILE ELAPSED_TIME_CSV
BY ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F3
BY ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F4
BY ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F5
BY ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F6
I grab the four fields from the source and sort.
Not sure if I should COUNT, HOLD then do a MATCH for WHERE TOTAL GT 1?
F3 is an employee id and each emplyee ID shows up 14 times in the flat file we are reporting against (once for each day of the 2 week pay period). But if these 4 fields match, the record is a dup and can not be imported and needs to be corrected. The payroll system will not takes duplicate records and just rejects them both. Leaving the employee with no hours worked for that day.
Am I in the right direction here?This message has been edited. Last edited by: Greg,
prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL
Since it appears all 4 fields are in the same record, why not:
WHERE ((F3 NE F4) AND (F4 NE F5) AND (F5 NE F6))
Granted, there will not be a 'No Duplicates Found' response without a little more coding, but, no record that has the same value in all 4 fields will get through.
Robert F. Bowley Jr. Owner TaRa Solutions, LLC
In WebFOCUS since 2001
Posts: 132 | Location: Gadsden, Al | Registered: July 22, 2005
I need a report that locates duplicate records in which four fields are the same. If a record contains the same values in f3,f4,f5 and f6 Then print the ENTIRE Record (24 fields).
Do you mean that f3=f4=f5=f6? Or do you mean that you have 2 or more records with the same values of f3, f4, f5, f6?
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
A multi-verb request like this might work, assuming duplicate values occur across records and not within records.
TABLE FILE ELAPSED_TIME_CSV
COUNT ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F3 NOPRINT
BY ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F3 NOPRINT
BY ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F4 NOPRINT
BY ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F5 NOPRINT
BY ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F6 NOPRINT
-*
PRINT *
BY ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F3 NOPRINT
BY ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F4 NOPRINT
BY ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F5 NOPRINT
BY ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F6 NOPRINT
WHERE TOTAL COUNT GT 1 ;
END
-RUN
-IF (&LINES GT 0) GOTO EXIT ;
-TYPE No Duplicates Found.
-EXIT
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
Originally posted by Dan Satchell: A multi-verb request like this might work, assuming duplicate values occur across records and not within records.
TABLE FILE ELAPSED_TIME_CSV
COUNT ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F3 NOPRINT
BY ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F3 NOPRINT
BY ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F4 NOPRINT
BY ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F5 NOPRINT
BY ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F6 NOPRINT
-*
PRINT *
BY ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F3 NOPRINT
BY ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F4 NOPRINT
BY ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F5 NOPRINT
BY ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F6 NOPRINT
WHERE TOTAL COUNT GT 1 ;
END
-RUN
-IF (&LINES GT 0) GOTO EXIT ;
-TYPE No Duplicates Found.
-EXIT
This code returns a page number and the names of all the fields in the table:
If you get an empty report, you could try: SET EMPTYREPORT = OFF. Otherwise, you might HOLD the output, then test &LINES to see whether to print the results or display a No Duplicates message.
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
I remember the LAST function which is shown in this example. It would allow you to compare f3 to LAST f3, f4 to LAST f4, etc. and select where there is equality in each of the four fields between two rows.
jimster06 DevStu WF 7.6.11 W7 HTML, PDF, EXL2K
Posts: 252 | Location: USA | Registered: April 15, 2003
-* File greg3.fex
TABLE FILE CAR
SUM CNT.SALES NOPRINT
BY COUNTRY NOPRINT
BY CAR NOPRINT
PRINT COUNTRY CAR RCOST DCOST SALES
BY COUNTRY NOPRINT
BY CAR NOPRINT
IF TOTAL CNT.SALES GT 1
END
will give only the duplicates.
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
How about concatenating the 4 separate fields into a single field? It then become easy to COUNT the number of times a particular record occurs. If it's more than one just keep a single instance in the output file.
-* File greg3.fex
TABLE FILE CAR
SUM CNT.SALES NOPRINT
BY COUNTRY NOPRINT
BY CAR NOPRINT
PRINT COUNTRY CAR RCOST DCOST SALES
BY COUNTRY NOPRINT
BY CAR NOPRINT
IF TOTAL CNT.SALES GT 1
END
will give only the duplicates.
This worked after I added sales as a by field.
prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL