Skip to content

Instantly share code, notes, and snippets.

@Luisoto
Created April 20, 2018 17:00
Show Gist options
  • Select an option

  • Save Luisoto/90add66dc9b39ad8fe57a49e6c19a79e to your computer and use it in GitHub Desktop.

Select an option

Save Luisoto/90add66dc9b39ad8fe57a49e6c19a79e to your computer and use it in GitHub Desktop.
Num. Shortlists job with at least one shortlist (Removed reported users)
SELECT
percentile_cont(totalShortlist,
0.75) OVER()
FROM (
SELECT
idJob,
COUNT(idJob) AS totalShortlist
FROM
`merlin_events.Event`
WHERE
timestamp >= TIMESTAMP("2018-02-14")
AND eventName = "Shortlist"
AND idUserCandidate NOT IN (
SELECT
value AS idUser
FROM
`merlin_events.Event`,
UNNEST(properties)
WHERE
eventName = "block-user-chat"
AND idUserEmployer IS NOT NULL
AND key = "id_user_blocked"
GROUP BY
idUser)
GROUP BY
idJob)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment