How to filter cards using multiple conditions?

Background:
Here are many folders or documents in hierarchy or levels in my knowledge base. In each document, some of the rems are taged and/or marked with an icon.

Here is my question: How to filter the cards (or rems) that meet both of the reuquirements :

  1. the filtered cards with both an icon “%%tirangle_flag (to be simple, a flag)” and (Note: “and” here means an intersection not union) a tag “#hard”.
  2. the cards are in a certain document (not the whole folder)

By the way, I have tried to use Filter annoted in the sceenshot below, but the result is not what I want. To be indetails,

  1. it filters the cards with a flag or tag “#hard” (Note: the multiple inputs are treated to be an union not an intersection.). That is not what I want.
  2. After a filtered portal is created, when I Pactice the rems, all the cards (here means not only the filtered ones) in the certain will be in the quene. That also is not what I want.

Anyone can help?
Thanks.

Here’s a workaround until queries are implemented. Basically, you add a search portal to a rem, type the first keyword, and then filter that rem for the second keyword. Then add the filter as a new search portal by pressing plus and turn that new portal into a queue by using the three dots menu in the upper left.

Thanks a lot.
I just tried as you suggested. This trick works.

And your advice is for requirement 1 mentioned, I think.
The filter seems to find or search in the whole base.
Since there are many folders or documents or rems in a knowledge base, how to force the filter to do the searching job within a certain or constrained document? (to be a little clear, maybe it could be called “source-constrained filter”.)

Try manually typing in isDescendant: name_of_the_document. There’s an example using the daily doc in the same thread.