I have a layer with several columns. One of them is called 'cod' and the other is called 'cod_2'. 'cod_2' is null, except for one row. I want to know if the numerical value of 'cod_2' is present in any row of 'cod'. I'll give you an example.
Cod Cod_2
1 NULL
1 NULL
18 NULL
3 NULL
42 18
42 NULL
7 NULL
18 is present in both columns, but not in the same row. So, I can't use
if("col"="col_2",1,0)
because it will return 0.
I've tried this solution (Comparing Column Contents in QGIS) but it's not working because I'm working with Graphical Moduler, thus I can't call the layer name. I've tried to use @layer_name but it didn't worked either.