How to make a aggregate function in bird ?