Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
santhana
Contributor III
Contributor III

Identify duplicate records upto Previous quarter

Hello Friends

I have attached data where I need to identify  Mobile numbers as Repeat if they were available upto end of previous quarter. 

Example: if mobile no of May is also available before 31st March (upto last Quarter)  then it is repeat. Else fresh.

Raw sheet is the data and Output sheet is the required result

1 Reply
sunny_talwar

Is this needed to be done in the script? If yes, then try this

Table:
LOAD *,
	 Date#(Month&'-'&Year, 'MMM-YYYY') as MonthYear;
LOAD Mob_No, 
     Month, 
     Year
FROM
[..\..\Downloads\Sample_Test.xlsx]
(ooxml, embedded labels, table is Raw);

FinalTable:
LOAD *,
	 If(Mob_No = Previous(Mob_No), 'Repeat', 'Fresh') as Result
Resident Table
Order By Mob_No, MonthYear;

DROP Table Table;