create temporary table for cohort