I want to filter entries in a base by property that has too many possible values, e.g. filter a list of books by year.
Proposed solution
Define a variable that is not part of any item but that is part of the base, let’s call it currentyear.
Then define a view that would filter by that property (property.year == currentyear).
Title is maybe inaccurate. I think you are asking user defined variables inside base queries i.e. my_variable = 2025 etc. Current workaround would be to write a template that uses my_variable then search and replace that variable with a value. I you want to batch generate views from different property values then you can use programming to generate your base file. Again title may be inaccurate if you meant batch generation.
The idea of dynamic queries inside dynamic queries is too complex to understand and implement. I would rather talk about batch generation of different base views.