Its not exactly a filter, but I didnt know exactly how to describe what I'm doing. I want to take a list of data. As shown:

What I wish to do... is to create some sort of loop that will take this data... use Valve_Type as the criteria... I want it to go down the list one by one.... Check if the current row is the same as the one before it. When it is not, I want it to create a row in a collection. Shown in this mockup below:

I will do some other complicated things, but I know how to do them. What I need to do is know how to do this efficiently. The source data is thousands of rows. I could do a forall(Data.Index, <formula>) but, I dont think you can break out of it once my criteria is not satisfied. It will have to go through thousands of rows for nothing, when its satisfied only in the first 5 rows.
GroupBy() will work either, because it accounts for the same value of the group column for the entire set. It wont stop squentially. Or, perhaps it will with some finessce. WHich, I do not know... so, I'm asking!!
Whatcha think?