createCohortTables function

Create cohort tables