I'm not totally clear on your requirement but would the HAVING keyword solve the problem? That's kind of like a WHERE but in the group by phase of the query..
What I need is to group by "fld4" if and only if its value is "TL". If its value is different than "TL" then no grouping should be performed on this field.