Hi Akshay,
Here's what you need to do:
1) Create a formula (@Status) with the code below:
If {TransactionNumber} = "Yes" then 1
2) Create another formula and place this on the Group Header:
If Max({@Status}, {GroupField}) = 1 then "Yes"
else "No"
Hope this helps.
-Abhilash