Calculating Avg of a variable from ES datasource

Thanks. Your solution on the below solved this issue too