i know about the relationship just trying to filter the relationship was the problem just decided on this approach.
public function hasChildCount($count, $catid)
{
$products = Mage::getModel('catalog/category')->load($catid)
->getProductCollection()
->addAttributeToFilter('type_id', array('eq' => 'grouped'));
foreach ($products as $product) {
$associatedProducts = $product->getTypeInstance(true)->getAssociatedProducts($product);
$countProducts = count($associatedProducts);
if(($count == 5 && $count >= $countProducts ))
{
$ids[] = $product->getId();
}elseif($count == $countProducts)
{
$ids[] = $product->getId();
}
// Do something with $associatedProducts
}
return $ids;
}
and then in the actual attribute to filter
array('entity_id'=>array('in',$idsIn ));