create approx avg and approx count udf