I have a system that imports data from a textfile weekly, it then returns all faulty rows to the source.
The system contains pricing data and agreement dates.
One of many faults can be faulty "split". A split occurs when a part is bought for example 40% from one
manufacturer and 60% from another. There can also be different prices for different months from the same manufacturer.
I use "AGR_DATE_FROM+AGR_DATE_TO+PN+FACTORY+[QTYFROM/DATEFROM]+[QTYTO/DATETO]" as unique indentifier for each row.
AGR_DATE : The date for the agreement.
PART_NUMBER: Unique number for this part
FACTORY: Where it's manufactured
QTY/DATE : A part can have a different price for different dates or for different quantities.
I have constructed a sp that spits out all faulty rows where the total split is not 100%. But the logic
fails when there is more than two suppliers during a period. It very seldom is but it occurs from time to time.