Select table lines based on condition and generic field
Hi there,
I have the following issue. I want to select a subset of data based on a condition and a group by of a field. So I have several lines with the same ID but I only want to select one of these fields. Below there is a part of the script. T_Key is the generic field and I only want to have the line where this condition holds:
MIN(FABS(PlannedArrivalDT-OrderDT))
However other fields, for instance Optimaldeliveryquantity, have different values for the lines belonging to the same T_Key. I only want to keep the value which belongs to the line where the condition holds. Anybody got a suggestion?
ORDERDETAIL_DP: LOAD Company & OrderDetailIDASOrderDetailID, NUM(OrderDT) ASOrderDT, ExtOrderLineNb, Company & APPLYMAP('MAPDPTS',OrderID) & StorageIDAST_Key,