You could add a Type field.
For your reference, here is an example from our own system, for similarly adding a criteria, when editing a filter function. For example, when adding a date value condition, the Created date ("Skapad"), dropping down the Value field, there is a date control.
In your case, there is an input box at that place. Now, if you want to add something that is not a value, there is a Type field that specifies how the Value control will behave.
When you change the Type from value to something else, the Value field with the date picker is replaced with a something else, for example a Formula dropdown menu. Here, we instead provide a set of predefined formulas.
So you could add a Type called "Field" and change your value input control to the appropriate corresponding control.
Thoughts:
You ask for a simple and intuitive interface. This might not be. Our customers often struggles with this feature. Most rather leave this kind condition making to a more skilled colleague or even a system admin or consultant of ours. There have been plenty of ideas to make this interface "sleeker" and more visually appealing.
At the same time, I do believe it is a powerful and maintainable approach. Would we one day have a new type or pre-written formula, adding it to this is cake. And would a customer have a need of constructing non-simple conditions, there is always a way.
Suggestion:
For starters, "provide for the possible" by trying to make your elements logically straight forward, like the above example, so that it gets easy to maintain and possible to use in all cases. But at the same time "Design for the probable" by not necessarily showing all this advanced stuff at once. (Quote: Alan Cooper)
Depending on what is probable in your case (which I did not get), you could work with expandable areas, using the most common and intuitive layout as your starting point.
ID > 5
orID > ID
; a filter can this have a value or another field. I would thus like to allow users to enter a value OR choose a field to be used for the comparison