enter image description here

I want to compare this field value with another field value

How can I do that?

Thank you very much!

  • You can consider the solution provided [here][1]. [1]: drupal.stackexchange.com/questions/44097/…
    – Anil Sagar
    Sep 24, 2012 at 10:41
  • thank you, but view php module is still in dev version.
    – cobenash
    Sep 25, 2012 at 2:46
  • i use hook_views_query_alter to achieve my goal. Thanks for sharing!
    – cobenash
    Sep 25, 2012 at 5:58
  • Check the other answers on suggested solution, too.
    – leymannx
    Jan 27, 2017 at 13:17

1 Answer 1


With latest views in 7 you have under global filters, "field comparison" filter that you can select any 2 fields which you added into fields of that view (they can be hidden fields) and that is it. Image below shows how this looks:

enter image description here

  • Is this still accurate? I can't seem to get it to come up in D8. I've got two node ID fields (one is a relationship), and I want to filter as long as those two ID fields are the same, but I'm only seeing Combine Filters in Global. Apr 12, 2017 at 20:18
  • Same issue, this does not seem to be included in D8. There is a "combine" but no "compare" fields
    – Hudri
    Jun 6, 2018 at 8:36
  • D8 issue tracking the feature: drupal.org/node/699252
    – imclean
    Nov 2, 2018 at 1:10

Not the answer you're looking for? Browse other questions tagged or ask your own question.