The OQL logic removes parts where the parameter is empty. This is also the case for a regular where statement like
A/Year = $YEAR.
You have to split this in two OQL statements and check the parameter in a the microflow logic. Call the appicable OQL