Have you ever wanted to implement a custom sql query for view? Recently, I was working on a project and I wanted to pass an argument to my filter. No matter what I tried doing it never really worked. Someone even suggested using a module which I never found so I started my research on how to manually pass this value to the already generated query.
Then I stumbled on the views hook called hook_views_pre_execute. What this hook does is, it overrides your initial query generated by the views module.