I thought the OP wanted to know how to loop through the result of a filter, not avoid double looping.