When I need to filter a view based on some elaborate condition, I often find myself using Drupal Views' contextual filters. Normally this kind of filter is supposed to pull the filter value from the URL, but it also lets you select other methods of finding a value if it’s not in the URL. For instance, if the filter is for the author, you can configure the view to use the current user’s ID. Even though this is very flexible, you may occasionally need filtering that cannot be set up with the available options.