Using masks in graph builder

I am working with the Snap 6. version and Sentinel3 images (S3A_OL_2_LFR). With a graph build I do a NDVI and then I try to apply the masks (LQSF_CLOUD + LQSF_CLOUD_AMBIGUOUS + LQSF_CLOUD_MARGIN + LQSF_SNOW_ICE) to put these pixels to 0. I have tried different ways but it always gives me an error. First I try with 2 different band maths operations in the same graph build but this way it doesn’t read good the masks.

And this other way I write in the same band maths:

LQSF_CLOUD_AMBIGUOUS + LQSF_CLOUD_MARGIN + LQSF_SNOW_ICE >= 0 ? 0 : (RC865 - RC681) / (RC865 - RC681) * 1000

But this way It doesn’t work.
Could you tell how can I do it?
Thanks in advance


I think the problem is in the syntax. You should use AND instead of + (probably what you really want to do is to use OR to include the three conditions). You also need to use the if (condition) then (action) else (action) format. I am not sure if assigning 0 is a good idea, since there must be zeros in your NDVI values. Use NaN or an absurd number (-9999).
Hope it helps.