Calculating concurrency with a by clause