Creating counter fields to avoid Count Distinct