Multiple latejoins with counter