Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Profile ID | Status | CustId |
780 | INPROG | 100 |
88 | INPROG | 200 |
789 | INPROG | 200 |
800 | INPROG | 300 |
Here the above given table has duplicate customer ID(200).
While loadind data from the table I would like to have the result like below by removing the duplicates completely.
Output: | ||
Profile ID | CustId | Status |
780 | 100 | Complt |
800 | 300 | Cancel |
Did you look at my response here:
Hi sunny,
Exact my problem is......
I have data like this......1000 records
sample data:
Barcode create_date prepared _By
123 24-04-2016 ravi
124 24-04-2016 teja
123 29--04- 2016 ---
345 26-04-2016 ----
346 26-04-2016 ---
345 29-04-2016 ---
I want these outputs:
0utput1:
Barcode create date prepared _By
123 24-04-2016 ravi
124 24-04-2016 teja
345 26-04-2016 ----
346 26-04-2016 ---
In above output using where condition prepared _By =''--' output2 will come no problem.
0utput2:
Barcode create date prepared _By
345 26-04-2016 ----
346 26-04-2016 ---
my main problem is output1 is not getting perfectly while using Thirumal script....its workinh some records its removing fst record and some times second records its removing.....In duplicate want remove only seconds time reapted records.
Hi raviteja, your request is different from the original poster, he wanted to remove all duplicates while you want to keep the first one.
To achieve that you only need to use exist(), ie:
LOAD * FROM [Sample_Data] where not Exists(Barcode)
If Barcode was loaded in previous tables you need to change the field name to check:
LOAD *, Barcode as BarcodeTmp FROM [Sample_Data] where not Exists(BarcodeTmp);
DROP Field BarcodeTmp;