project function

project data by grouping, and adding aggregate columns.