<html><head></head><body style="zoom: 0%;"><div dir="auto">You definitely need to define the layer for each attribute (except the current layer).<br><br></div>
<div dir="auto">You also need a way to find the comparable record, e.g. <br></div>
<div dir="auto">(i) with a common id (use getfeature() to access attribute) or<br></div>
<div dir="auto">(ii) spatially use one of the overlay functions. <br><br></div>
<div dir="auto">Oisin <br><br></div>
<div dir="auto">Get BlueMail for Android </div>
<div class="gmail_quote" >On 14 May 2024, at 19:52, Guillermo Parra via QGIS-User <<a href="mailto:qgis-user@lists.osgeo.org" target="_blank">qgis-user@lists.osgeo.org</a>> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="ydpd4979106yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div><div dir="ltr" data-setdir="false">Hi,</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">I have several tables with the same fields, same grid information, but different field data for each one (information from different providers, let's say).</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Particularly, I have a field with 0 and 1 which represent if each provider have, or not have coverage in that area.</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">I want to compare the values of each table to set "1" if at least one of the providers have coverage in each area, or "0" if None of them have it, so I used the field calculator and the expression builder with this sql statement:</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"><div><div>if( 'H3centr_h9_cobcubierto'  = 1 OR </div><div>'H3centr_h9_cobcubierto' = 1 OR</div><div>'H3centroides_h9_cobGT3D cubierto' = 1 OR</div><div>'H3centroides_h9_cob_cubierto'  = '1' OR</div><div>'H3centr_h9_cob_cubierto' = '1' OR</div><div>'H3cent_cob_cubierto'  = '1' OR</div><div>"H3centrR9_Tc3D_cubierto"  ='1', 1, 0)</div></div><br></div><div dir="ltr" data-setdir="false">The problem is that apparently it is considering only the last field in double quotes (which is in the same table that the new column where I want to fill the data), and the other fields apparently are beign ignored.</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">I would guest that it would be better to specify the table and field where each data will be taken ( like  <div><div style="color: rgb(0, 0, 0); font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;">if( 'Table1.H3centr_h9_cobcubierto'  = 1 OR </div><div style="color: rgb(0, 0, 0); font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;" dir="ltr" data-setdir="false">'Table2.H3centr_h9_cobcubierto' = 1 OR... etc.)</div></div><div style="color: rgb(0, 0, 0); font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;" dir="ltr" data-setdir="false">but when I make double click over each layer field, QGIS writes it that way, so I asume it is correct.</div><div style="color: rgb(0, 0, 0); font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;" dir="ltr" data-setdir="false"><br></div><div style="color: rgb(0, 0, 0); font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;" dir="ltr" data-setdir="false">So, if someone have an idea on how I can make it work, I would greatly appreciate any suggestion.</div><div style="color: rgb(0, 0, 0); font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;" dir="ltr" data-setdir="false">Thanks,</div><div style="color: rgb(0, 0, 0); font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;" dir="ltr" data-setdir="false"><br></div></div><div dir="ltr" data-setdir="false">Guillermo.</div><div dir="ltr" data-setdir="false"><br></div><div><br></div><div class="ydpd4979106signature">Guillermo Parra Montealegre e-mail: meminp_24@yahoo.com</div></div></div><pre class="blue"><hr><br>QGIS-User mailing list<br>QGIS-User@lists.osgeo.org<br>List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br></pre></blockquote></div></body></html>