Hi Luca,
What my understanding is you have some filed "YYYY", if "YYYY" filed = complaint then 0 else 1 after that type of filed is " XX" then you want assign that field as Null means you also assign 0 for that or NULL?
what abhi said if you provide the report with sample data that is really help full to understand your issue.
--Naga