Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
TabA:
Load * Inline
[
ID,Purchase_Date,Purchase,item
1,27/03/2022,500,charger
2,28/05/2022,700,mobile
2,28/05/2022,100,charger
1,27/03/2022,600,mobile
1,29/03/2022,300,laptop
3,30/01/2022,400,camera
];
Here's the sample data-
i want if the ID and date is repeating same for that ID then it should create new flag as 'Purchaser'
and if that ID is purchasing on different date then 'Repurchase'
ex-D,Purchase_Date,Purchase,item,flag
1,27/03/2022,500,charger,Repurchase
2,28/05/2022,700,mobile,Purchase
2,28/05/2022,100,charger,Purchase
1,27/03/2022,600,mobile,Repurchase
1,29/03/2022,300,laptop,Repurchase
3,30/01/2022,400,camera,Purchase
Try this,
TabA:
Load RowNo() As RowID,* Inline
[
ID,Purchase_Date,Purchase,item
1,27/03/2022,500,charger
2,28/05/2022,700,mobile
2,28/05/2022,100,charger
1,27/03/2022,600,mobile
1,29/03/2022,300,laptop
3,30/01/2022,400,camera
];
Left Join(TabA)
LOAD ID, If(Count(DISTINCT Purchase_Date)>1,'Repurchase','Purchase') As flag
Resident TabA
Group By ID;
Try this,
TabA:
Load RowNo() As RowID,* Inline
[
ID,Purchase_Date,Purchase,item
1,27/03/2022,500,charger
2,28/05/2022,700,mobile
2,28/05/2022,100,charger
1,27/03/2022,600,mobile
1,29/03/2022,300,laptop
3,30/01/2022,400,camera
];
Left Join(TabA)
LOAD ID, If(Count(DISTINCT Purchase_Date)>1,'Repurchase','Purchase') As flag
Resident TabA
Group By ID;