Passer au contenu principal

Details for users whose custom user field value is above average field value - Remarques / DPQL Reports - Deskpro Support

16

Details for users whose custom user field value is above average field value Report

This query generates a list of users who have a value for a custom field which is above the average of that value for all users.

SELECT people.name, people.emails.email, people.custom_data[#] 

FROM people 

WHERE people.custom_data[#] > (SELECT AVG(people.custom_data[#]) FROM people) 

Here we use a sub-query in the WHERE clause to find an average of the field.

We are then able to use our query to SELECT against that data we have found, so the query will output user details for users where this value is above Zero.

Ajouter un commentaire

Veuillez vous connecter ou vous enregistrer pour soumettre un commentaire.

Mot de passe oublié ?