The selection formula can use whatever info is contained in a given document.
You cannot use @dblookups or any other method that attemps to gather info from outside the document.
You must understand that it is the document that is being evaluated. Thus, your selection formula must comprise all the possibilities of data values contained in the fields you want to control that exist on the documents you are selecting.
You cannot, however, condition the value of a field in a document to the value of a field in another document, since the other document is outside the scope of the selection formula at that time.