private static Expression<?> getExpressionPathAndFunctions(
			CriteriaBuilder cb, Path<String> pathString, String element,
			String function) {
		Expression<?> expr = null;
		Path<Number> pNumber = getNumberPath(pathString, element);
		if (function.equalsIgnoreCase("count")) {
			/**
			 * field that can be numeric or not
			 */
			expr = cb.count(pathString);
		} else if (function.equalsIgnoreCase("sum")) {
			expr = cb.sum(pNumber);
		} else if (function.equalsIgnoreCase("avg")) {
			expr = cb.avg(pNumber);
		} else if (function.equalsIgnoreCase("min")) {
			expr = cb.min(pNumber);
		} else if (function.equalsIgnoreCase("max")) {
			expr = cb.max(pNumber);
		}
		return expr;
	}