Hi all!
I have a data table DT1 with a bunch of columns and rows. The rows represent orders and there’s one row per order per status. So, if an order has more than one status there are several rows for the same order ID. At some point in time an order may be given a value in Attr1 and if Attr2 has certain value I would like to copy Attr1 to all rows of the same order ID. Any ideas how to solve this?
So if Attr1 is not null and Attr2=r, Attr1 should be copied to all rows with the same order ID.
This is the table now:
OrderID, Status, Attr1,Attr2
123, 1, Null, r
123, 2, Null, r
123, 3, z, r
321,1,Null, y
321,2,Null, y
This is my desired result:
OrderID, Status, Attr1
123, 1, z, r
123, 2, z, r
123, 3, z, r
321,1,Null,y
321,2,Null,y
Thanks in advance…
