Not sure if this is what you are looking for.
Try this in the script and then do a Sum(Flag_Dup) in the font end.
Hope it work
Bidder & '_' & Company as Key_Bidder_Comp,
Transaction & '_' & Bidder as Sort_Key_Trans_Bidder,
Row, Transaction, Bidder, Company
1,1001, AA, XYZ
2,1001, AA, KID
3,1004, DD, YOO
4,1004, DD, YOO
5,1005, EE, JOK
6,1005, EE, JOK
7,1005, EE, QID
if(Key_Bidder_Comp = Previous(Key_Bidder_Comp),1,0)) as Flag_Dup
Order by Sort_Key_Trans_Bidder;
Drop Table TEMP;