AnsweredAssumed Answered

Enforce Unique gives me the first record out of the duplicates record in single document. But , I want the last record out of those duplicate records in single document . please let me know how can I fetch that ?

Question asked by akabhatnagar@deloitte.com on Oct 20, 2016
Latest reply on Oct 20, 2016 by Seth Duda

Enforce Unique gives me the first record out of the duplicate records in single document. But, I want the last record out of those duplicate records in the single document.

For Ex. I have below records in FF profile and all these are in single document. 

My third element is start date. Thus, I want records with unique STARTDATE and that too the last one out of duplicate start date.

 

// Although in my document , I dont have header . I am writing here just to identify the fields.

 

Empno,Flag1,STARTDATE,ENDDATE,flag2,Duration,flag3,RecordCount  --------- header  

00800230,True,20161012,20161019,False,8,False,0

00800230,False,20161021,20161022,False,2,False,1

00800230,False,20161021,20161026,False,6,True,2

00800230,False,20161021,20161030,False,10,True,3

00800230,False,20161101,20161102,False,2,False,4

00800230,False,20161101,20161104,False,4,True,5

00800230,False,20161106,20161109,False,4,False,6

00800230,False,20161106,20161112,False,7,True,7

00800230,False,20161106,20161119,False,14,True,9

00800230,False,20161126,20161127,False,2,False,11

00800230,False,20161201,20161205,False,5,False,13

 

 

I want records which are shown below - 

 

00800230,True,20161012,20161019,False,8,False,0

00800230,False,20161021,20161030,False,10,True,3

00800230,False,20161101,20161104,False,4,True,5

00800230,False,20161106,20161119,False,14,True,9

00800230,False,20161126,20161127,False,2,False,11

00800230,False,20161201,20161205,False,5,False,13

 

Please guide me on this .

Outcomes