Using aggregated variables to create new fields