Hi, RowId() returns the line number of the row in the result set, and so would ignore any args passed to it.You can get the 1st delivery, 2nd delivery.. with rownum(partitionby([@recipient-id]), orderby(min(@eventdate)) = 1, 2.. on broadlogrcp. From there it's a join to trackinglogrcp for the counts...