Update getCohortSize to work with new sql