Counting orders w/ new items
The CTE first finds the first order than every item was purchased (per customer and factory) and then we simply count the distinct order IDs (and subtract 1 as the very first order doesn't count):

with cta as
(
  select 
      FactoryID, CustomerID,  
      min(RelatedRecordID) as MinRelatedRecordID
  from 
      Table1
  group by 
      FactoryID, CustomerID, ItemID
)
select 
    FactoryID, CustomerID, 
    count(distinct MinRelatedRecordID)-1 as OrdersWithNewItems 
from 
    cta 
group by 
    FactoryID, CustomerID 
having 
    count(distinct MinRelatedRecordID) &gt; 3 ;


Tested in SQLfiddle.com