Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved] Report Duplicate Records

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved] Report Duplicate Records
 Login/Join
 
Platinum Member
posted
The how-to article to find duplicate records is 404.

https://techsupport.informatio...om/sps/81071020.html

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

 
Posts: 133 | Location: Orlando, FL | Registered: August 04, 2005Report This Post
Platinum Member
posted Hide Post
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, 2005Report This Post
Virtuoso
posted Hide Post
Greg,
You say:
quote:
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, 2006Report This Post
Virtuoso
posted Hide Post
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, 2007Report This Post
Platinum Member
posted Hide Post
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?[/QUOTE]

Records with the same values in all four fields.

not f3=f4=f5=f6

ex:

F3 F4 F5 F6
115262 0 2012-09-28 1
115262 0 2012-09-28 1

This would be a dup and end up on the report.


prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL

 
Posts: 133 | Location: Orlando, FL | Registered: August 04, 2005Report This Post
Platinum Member
posted Hide Post
quote:
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:

PAGE 1

F1 F2 F3 F4 F5X F6 F7 F8 F9 F10 F11X F12 F13 F14 F15 F16 F17 F18 F19 F20 F21 F22 F23 F24 F25


prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL

 
Posts: 133 | Location: Orlando, FL | Registered: August 04, 2005Report This Post
Virtuoso
posted Hide Post
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, 2007Report This Post
Platinum Member
posted Hide Post
The falt file I am reporting against has 2 duplicates records in it for testing.

These are not being reported with the above code.


prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL

 
Posts: 133 | Location: Orlando, FL | Registered: August 04, 2005Report This Post
Guru
posted Hide Post
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, 2003Report This Post
Virtuoso
posted Hide Post
Greg,

Using the famous CAR 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.


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, 2006Report This Post
Master
posted Hide Post
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.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report This Post
Platinum Member
posted Hide Post
quote:
Originally posted by Danny-SRL:
Greg,

Using the famous CAR 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

 
Posts: 133 | Location: Orlando, FL | Registered: August 04, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved] Report Duplicate Records

Copyright © 1996-2020 Information Builders