Reducing data size by filtering and collapsing