<html><head></head><body style="zoom: 0%;"><div dir="auto">get_feature(layer, attribute, value)<br><br></div>
<div dir="auto">This returns a feature. You can then wrap this in attributes() to return a dictionary of attribute names and  values.<br><br></div>
<div dir="auto">You then add ['attributename'] on end to return value.<br><br></div>
<div dir="auto">So for each table <br></div>
<div dir="auto"> something like<br><br></div>
<div dir="auto">attributes(get_feature('table1', 'common-id-name', "common-id-name"))['H3centr-h9...']<br><br></div>
<div dir="auto">Does this make sense<br><br></div>
<div dir="auto"><!-- tmjah_g_1299s -->Oisin<!-- tmjah_g_1299e --><br><br><br></div>
<div dir="auto"><!-- tmjah_g_1299s -->Get BlueMail for Android <!-- tmjah_g_1299e --></div>
<div class="gmail_quote" >On 14 May 2024, at 20:35, Guillermo Parra <<a href="mailto:meminp_24@yahoo.com" target="_blank">meminp_24@yahoo.com</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="ydp6701ce81yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;">
 <div>
  <div dir="ltr" data-setdir="false">
   Hello Oisin,
  </div>
  <div dir="ltr" data-setdir="false">
   <br>
  </div>
  <div dir="ltr" data-setdir="false">
   Thank you for your guidance regarding this topic, and I am sorry if I need further assistance, but I'm kind of new to QGIS.
  </div>
  <div dir="ltr" data-setdir="false">
   <br>
  </div>
  <div dir="ltr" data-setdir="false">
   Regarding the need to define the layer for each attribute, will it work if I stated like I had wroten before? i.e.:
  </div>
  <div dir="ltr" data-setdir="false">
   <div>
    <div style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px; color: rgb(0, 0, 0); outline: none !important;">
     'Table1.H3centr_h9_cobcubierto'  = 1 OR 
    </div>
    <div dir="ltr" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px; color: rgb(0, 0, 0); outline: none !important;">
     'Table2.H3centr_h9_cobcubierto' = 1 
    </div>
   </div>Will QGIS recognize it?
  </div>
  <div dir="ltr" data-setdir="false">
   <br>
  </div>
  <div dir="ltr" data-setdir="false">
   And to find the comparable record, certaingly I can use a common id. So I will explore the getfeature( ) tool that you suggest, thank you very much.
  </div>
  <div dir="ltr" data-setdir="false">
   <br>
  </div>
  <div dir="ltr" data-setdir="false">
   Regards.  
  </div>
  <div dir="ltr" data-setdir="false">
   <br>
  </div>
  <div>
   <br>
  </div>
  <div class="ydp6701ce81signature">
   Guillermo Parra Montealegre e-mail: meminp_24@yahoo.com
  </div>
 </div>
 <div>
  <br>
 </div>
 <div>
  <br>
 </div>
</div>
<div id="ydp8772f26dyahoo_quoted_6462001013" class="ydp8772f26dyahoo_quoted">
 <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
  <div>
   El martes, 14 de mayo de 2024, 13:23:07 GMT-6, oisin.kelly.wild@gmail.com <oisin.kelly.wild@gmail.com> escribió:
  </div>
  <div>
   <br>
  </div>
  <div>
   <br>
  </div>
  <div>
   <div id="ydp8772f26dyiv9615049115">
    <div>
     <div>
      You definitely need to define the layer for each attribute (except the current layer).
      <br clear="none">
      <br clear="none">
     </div>
     <div>
      You also need a way to find the comparable record, e.g. 
      <br clear="none">
     </div>
     <div>
      (i) with a common id (use getfeature() to access attribute) or
      <br clear="none">
     </div>
     <div>
      (ii) spatially use one of the overlay functions. 
      <br clear="none">
      <br clear="none">
     </div>
     <div>
      Oisin 
      <br clear="none">
      <br clear="none">
     </div>
     <div>
      Get BlueMail for Android
     </div>
     <div class="ydp8772f26dyiv9615049115gmail_quote">
      On 14 May 2024, at 19:52, Guillermo Parra via QGIS-User <<a shape="rect" href="mailto:qgis-user@lists.osgeo.org" rel="nofollow" target="_blank">qgis-user@lists.osgeo.org</a>> wrote:
      <blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex;" class="ydp8772f26dyiv9615049115gmail_quote">
       <div id="ydp8772f26dyiv9615049115yqt63110" class="ydp8772f26dyiv9615049115yqt5862070833">
        <div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;" class="ydp8772f26dyiv9615049115ydpd4979106yahoo-style-wrap">
         <div>
          <div dir="ltr">
           Hi,
          </div>
          <div dir="ltr">
           <br clear="none">
          </div>
          <div dir="ltr">
           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">
           <br clear="none">
          </div>
          <div dir="ltr">
           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">
           <br clear="none">
          </div>
          <div dir="ltr">
           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">
           <br clear="none">
          </div>
          <div dir="ltr">
           <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 clear="none">
          </div>
          <div dir="ltr">
           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">
           <br clear="none">
          </div>
          <div dir="ltr">
           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 dir="ltr" style="color:rgb(0, 0, 0);font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;">
             'Table2.H3centr_h9_cobcubierto' = 1 OR... etc.)
            </div>
           </div>
           <div dir="ltr" style="color:rgb(0, 0, 0);font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;">
            but when I make double click over each layer field, QGIS writes it that way, so I asume it is correct.
           </div>
           <div dir="ltr" style="color:rgb(0, 0, 0);font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;">
            <br clear="none">
           </div>
           <div dir="ltr" style="color:rgb(0, 0, 0);font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;">
            So, if someone have an idea on how I can make it work, I would greatly appreciate any suggestion.
           </div>
           <div dir="ltr" style="color:rgb(0, 0, 0);font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;">
            Thanks,
           </div>
           <div dir="ltr" style="color:rgb(0, 0, 0);font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;">
            <br clear="none">
           </div>
          </div>
          <div dir="ltr">
           Guillermo.
          </div>
          <div dir="ltr">
           <br clear="none">
          </div>
          <div>
           <br clear="none">
          </div>
          <div class="ydp8772f26dyiv9615049115ydpd4979106signature">
           Guillermo Parra Montealegre e-mail: meminp_24@yahoo.com
          </div>
         </div>
        </div>
       </div>
       <pre class="ydp8772f26dyiv9615049115blue"></pre>
       <hr>
       <br clear="none">
       QGIS-User mailing list
       <br clear="none">
       QGIS-User@lists.osgeo.org
       <br clear="none">
       List info: <a shape="rect" href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="nofollow" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
       <br clear="none">
       Unsubscribe: <a shape="rect" href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="nofollow" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
       <br clear="none">
      </blockquote>
     </div>
    </div>
   </div>
  </div>
 </div>
</div></blockquote></div></body></html>