Check for empty parameters in nested if-clause

i have a situation where i want to compose a string in my module, depending if two parameters are set. I am using this:

{{if (parameters.mandator, if (  parameters.filter,  'Mandant eq ' + parameters.mandator + ' and (' + parameters.filter + ')','Mandant eq ' + parameters.mandator ), parameters.filter)}}

But now matter if value is set for mandator or filter, this returns always the value of filter (as if both values are null). What am I doing wrong?

Best Regards