Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a table with duplicate values in on column.
I need to do some logic for duplicate records.
this is my table
Item | Qty | Cost |
Item1 | 1 | 100 |
Item1 | 1 | 101 |
Item1 | 1 | 100 |
item2 | 1 | 200 |
item3 | 2 | 300 |
This the Output i need.
Item | Qty | Cost | Duplicate | Revised Qty |
Item1 | 1 | 100 | No | 1 |
Item1 | 1 | 101 | Yes | 0 |
Item1 | 1 | 100 | Yes | 0 |
item2 | 1 | 200 | No | 1 |
item3 | 2 | 300 | No | 2 |
How to do this using load script or set analysis?
Thanks,
John.
HI
Check this,
LOAD *, if(Item=Peek(Item) and Qty=Peek(Qty),0,Qty) as RevisedQty;
load * Inline [
Item Qty Cost
Item1 1 100
Item1 1 101
Item1 1 100
item2 1 200
item3 2 300
] (delimiter is \t);