<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><br><br><div dir="ltr"><div dir="ltr"><div><image (1).png></div><div><image.png></div>I try to answer without attached images (size limit)...</div><div dir="ltr"><br><div><div><div>values are correct. I made first a virtual field in which I have "N" or "R" in the "Colore" filed through an expression and it works. My problem is the colour now.</div></div><div><br></div><div>I tried also with 'Colore' instead of "Colore", but nothing change.</div><div><br></div><div>Here the code:</div><span class="gmail-im" style="color:rgb(80,0,80)"><div><br></div><div>CASE<br>When<br>get_feature('V_TB_ATTIVITA_PT_NR','Colore','N')='N' then color_rgb (0,0,0)<br>When<br>get_feature('V_TB_ATTIVITA_PT_NR','Colore','R')='R' then color_rgb (255,0,0)<br>END<br></div><div><br></div></span><div>I'm pretty sure that in expression.... 'V_TB_ATTIVITA_PT_NR','Colore','N'... 'N' does not have sense, but I don't know what to pu... sorry, but I'm a super beginner with code :(</div><div><br></div><div>Cheers</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno mar 18 mag 2021 alle ore 08:39 Dario C <<a href="mailto:dario955i@gmail.com">dario955i@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><image.png></div><div><image.png></div><div><br><div>values are correct. I made first a virtual field in which I have "N" or "R" in the "Colore" filed through an expression and it works. My problem is the colour now.</div></div><div><br></div><div>I tried also with 'Colore' instead of "Colore", but nothing change.</div><div><br></div><div>Here the code:</div><div><br></div><div>CASE<br>When<br>get_feature('V_TB_ATTIVITA_PT_NR','Colore','N')='N' then color_rgb (0,0,0)<br>When<br>get_feature('V_TB_ATTIVITA_PT_NR','Colore','R')='R' then color_rgb (255,0,0)<br>END<br></div><div><br></div><div>I'm pretty sure that in expression....

'V_TB_ATTIVITA_PT_NR','Colore','N'... 'N' does not have sense, but I don't know what to pu... sorry, but I'm a super beginner with code :(</div><div><br></div><div>Cheers</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno mar 18 mag 2021 alle ore 08:32 Ujaval Gandhi <<a href="mailto:ujaval@spatialthoughts.com" target="_blank">ujaval@spatialthoughts.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">get_feature() will get you the feature.Your current expression will get you the first feature from 'V_TB_ATTIVITA_PT_NR' layer where the "Colore" value is 'N'. - I don't think that is what you want.  You need to query for a feature from another layer that relates to the current feature, (using a common field value).   Once you get the feature, you can use the attributes(feature)['Colore'] to read the "Colore' field from that feature. <div><br clear="all"><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div></div><div><table cellpadding="0" cellspacing="0" style="border-spacing:0px;border-collapse:collapse;color:rgb(68,68,68);width:480px;font-size:10pt;font-family:Arial,sans-serif;line-height:normal"><tbody><tr><td valign="top" style="padding:10px 0px 12px;width:160px;vertical-align:top"><a href="https://spatialthoughts.com/" style="background-color:transparent;color:rgb(51,122,183)" target="_blank"><img border="0" alt="Logo" width="141" src="https://ci5.googleusercontent.com/proxy/WH3VxFU-ICge6TUrQju3eMeYcQ2R9-ld-E8Nbh8RSnS54re-nSCbZ79AND2h9JSdMXR9pfyGfWKTae8DjBjdejeosyVzJLMB_Cqrlu_g4HGeDd1l9fwKz1XEoPwRnOh7U6szU2dVzi1w=s0-d-e1-ft#https://spatialthoughts685850346.files.wordpress.com/2019/12/spatial_thoughts_logo.png" style="border: 0px; vertical-align: middle; width: 141px; height: auto;" data-unique-identifier=""></a></td><td style="padding:6px 0px;width:320px"><table cellpadding="0" cellspacing="0" style="border-spacing:0px;border-collapse:collapse;background-color:transparent"><tbody><tr><td style="padding:0px;font-size:12pt;font-family:Arial,sans-serif;font-weight:bold;color:rgb(61,60,63)"><span style="color:rgb(0,175,239)">Ujaval Gandhi</span></td></tr><tr><td style="padding:0px 0px 11px;font-size:10pt;font-family:Arial,sans-serif;color:rgb(61,60,63)"><span style="color:rgb(0,175,239)">Spatial Thoughts</span></td></tr><tr><td style="padding:0px;font-size:10pt;font-family:Arial,sans-serif;color:rgb(155,155,155)"><span>mobile: +91-8095684687</span></td></tr><tr><td style="padding:0px;font-size:10pt;font-family:Arial,sans-serif;color:rgb(155,155,155)"><span>email: </span><span style="color:rgb(23,147,210)"><a href="mailto:ujaval@spatialthoughts.com" target="_blank">ujaval@spatialthoughts.com</a></span></td></tr><tr><td style="padding:6px 0px 0px"><span style="display:inline-block;height:22px"><span><a href="https://www.linkedin.com/in/spatialthoughts/" style="background-color:transparent;color:rgb(51,122,183)" target="_blank"><img alt="LinkedIn icon" border="0" width="23" height="23" src="https://ci4.googleusercontent.com/proxy/gJw317f0lmJaqpDQRh1mYIkgAnx-cU0JOt635ZaenUm0tcLAH1RyzcvmgEVT-cUcvFAIDdeH--60fB_uwTeZMJBhPyJ3rdt4lxTYe6KCVHkOxawIbL4ArTf3WEy6ls8X9h2sfgr0BdI=s0-d-e1-ft#https://codetwocdn.azureedge.net/images/mail-signatures/generator/elegant-logo/ln.png" style="border: 0px; vertical-align: middle; height: 20px; width: 20px;" data-unique-identifier=""></a>  </span><span><a href="https://twitter.com/spatialthoughts" style="background-color:transparent;color:rgb(51,122,183)" target="_blank"><img alt="Twitter icon" border="0" width="23" height="23" src="https://ci3.googleusercontent.com/proxy/Dbn_TtB7OiMAg6-GYo-Kae3CqkD8BBA7GAsHJu1u93_KS9b5cNrRR4ReYRdZPK156tjTsPpSd9YrFpluY0Ep3pra01_ltrS2I5-LC_qJxjl6sU0NnsY4FCII6B3U_Cu3VNTiQzPg99I=s0-d-e1-ft#https://codetwocdn.azureedge.net/images/mail-signatures/generator/elegant-logo/tt.png" style="border: 0px; vertical-align: middle; height: 20px; width: 20px;" data-unique-identifier=""></a>  </span></span></td></tr></tbody></table></td></tr><tr><td colspan="2" style="padding:8px 0px 0px;border-top:1px solid rgb(23,147,210);width:480px;font-family:Arial,sans-serif;color:rgb(155,155,155);text-align:justify"></td></tr></tbody></table><br></div></div></div></div></div></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 18, 2021 at 4:35 AM Delaz J <<a href="mailto:delazj@gmail.com" target="_blank">delazj@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div>
    <p>Hi Dario,</p>
    <p>Could you try with 'Colore' and not "Colore" (pay attention to
      the simple vs double quotes)?</p>
    <p>Regards,</p>
    <p>Harrissou<br>
    </p>
    <div>Le 18/05/2021 à 00:41, Dario C a
      écrit :<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">  Hi, thank you for your reply, but I still don't
        understand how to do... sorry
        <div><br>
        </div>
        <div>i tried to write this code in colour expression, but I
          don't understand what "value" is in get_feature
          :</div>
        <div><br>
        </div>
        <div>CASE<br>
          When<br>
          get_feature('V_TB_ATTIVITA_PT_NR',"Colore",'N')='N' then
          color_rgb (0,0,0)<br>
          When<br>
          get_feature('V_TB_ATTIVITA_PT_NR',"Colore",'R')='R' then
          color_rgb (255,0,0)<br>
          END<br>
        </div>
        <div><br>
        </div>
        <div>Consider that I have a virtual field called "Colore" where
          I have 'N' or 'R' in case it is black or red color.</div>
        <div><br>
        </div>
        <div>Thank you for your kind availability.</div>
        <div><br>
        </div>
        <div>cheers</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">Il giorno lun 17 mag 2021 alle
          ore 09:09 Ujaval Gandhi <<a href="mailto:ujaval@spatialthoughts.com" target="_blank">ujaval@spatialthoughts.com</a>> ha
          scritto:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div dir="ltr">You can select the layer under 'Plot
            Parameters' and its attributes will be available in the
            expression. (see attached screenshot).
            <div><br>
            </div>
            <div>If you need to get the attribute from another layer,
              you can use the get_feature() function to get feature from
              another layer by specifying the layer name.<br clear="all">
              <div>
                <div dir="ltr">
                  <div dir="ltr">
                    <div>
                      <div dir="ltr">
                        <div>
                          <div dir="ltr">
                            <div>
                              <div dir="ltr">
                                <div dir="ltr">
                                  <div dir="ltr">
                                    <div>
                                      <table style="border-spacing:0px;border-collapse:collapse;color:rgb(68,68,68);width:480px;font-size:10pt;font-family:Arial,sans-serif;line-height:normal" cellspacing="0" cellpadding="0">
                                        <tbody>
                                          <tr>
                                            <td style="padding:10px 0px 12px;width:160px;vertical-align:top" valign="top"><a href="https://spatialthoughts.com/" style="background-color:transparent;color:rgb(51,122,183)" target="_blank"><img alt="Logo" src="https://ci5.googleusercontent.com/proxy/WH3VxFU-ICge6TUrQju3eMeYcQ2R9-ld-E8Nbh8RSnS54re-nSCbZ79AND2h9JSdMXR9pfyGfWKTae8DjBjdejeosyVzJLMB_Cqrlu_g4HGeDd1l9fwKz1XEoPwRnOh7U6szU2dVzi1w=s0-d-e1-ft#https://spatialthoughts685850346.files.wordpress.com/2019/12/spatial_thoughts_logo.png" style="border: 0px; vertical-align: middle; width: 141px; height: auto;" width="141" border="0" data-unique-identifier=""></a></td>
                                            <td style="padding:6px 0px;width:320px">
                                              <table style="border-spacing:0px;border-collapse:collapse;background-color:transparent" cellspacing="0" cellpadding="0">
                                                <tbody>
                                                  <tr>
                                                    <td style="padding:0px;font-size:12pt;font-family:Arial,sans-serif;font-weight:bold;color:rgb(61,60,63)"><span style="color:rgb(0,175,239)">Ujaval Gandhi</span></td>
                                                  </tr>
                                                  <tr>
                                                    <td style="padding:0px 0px 11px;font-size:10pt;font-family:Arial,sans-serif;color:rgb(61,60,63)"><span style="color:rgb(0,175,239)">Spatial Thoughts</span></td>
                                                  </tr>
                                                  <tr>
                                                    <td style="padding:0px;font-size:10pt;font-family:Arial,sans-serif;color:rgb(155,155,155)"><span>mobile:
                                                        +91-8095684687</span></td>
                                                  </tr>
                                                  <tr>
                                                    <td style="padding:0px;font-size:10pt;font-family:Arial,sans-serif;color:rgb(155,155,155)"><span>email: </span><span style="color:rgb(23,147,210)"><a href="mailto:ujaval@spatialthoughts.com" target="_blank">ujaval@spatialthoughts.com</a></span></td>
                                                  </tr>
                                                  <tr>
                                                    <td style="padding:6px 0px 0px"><span style="display:inline-block;height:22px"><span><a href="https://www.linkedin.com/in/spatialthoughts/" style="background-color:transparent;color:rgb(51,122,183)" target="_blank"><img alt="LinkedIn icon" src="https://ci4.googleusercontent.com/proxy/gJw317f0lmJaqpDQRh1mYIkgAnx-cU0JOt635ZaenUm0tcLAH1RyzcvmgEVT-cUcvFAIDdeH--60fB_uwTeZMJBhPyJ3rdt4lxTYe6KCVHkOxawIbL4ArTf3WEy6ls8X9h2sfgr0BdI=s0-d-e1-ft#https://codetwocdn.azureedge.net/images/mail-signatures/generator/elegant-logo/ln.png" style="border: 0px; vertical-align: middle; height: 20px; width: 20px;" width="23" height="23" border="0" data-unique-identifier=""></a>  </span><span><a href="https://twitter.com/spatialthoughts" style="background-color:transparent;color:rgb(51,122,183)" target="_blank"><img alt="Twitter icon" src="https://ci3.googleusercontent.com/proxy/Dbn_TtB7OiMAg6-GYo-Kae3CqkD8BBA7GAsHJu1u93_KS9b5cNrRR4ReYRdZPK156tjTsPpSd9YrFpluY0Ep3pra01_ltrS2I5-LC_qJxjl6sU0NnsY4FCII6B3U_Cu3VNTiQzPg99I=s0-d-e1-ft#https://codetwocdn.azureedge.net/images/mail-signatures/generator/elegant-logo/tt.png" style="border: 0px; vertical-align: middle; height: 20px; width: 20px;" width="23" height="23" border="0" data-unique-identifier=""></a>  </span></span></td>
                                                  </tr>
                                                </tbody>
                                              </table>
                                            </td>
                                          </tr>
                                          <tr>
                                            <td colspan="2" style="padding:8px 0px 0px;border-top:1px solid rgb(23,147,210);width:480px;font-family:Arial,sans-serif;color:rgb(155,155,155);text-align:justify"><br>
                                            </td>
                                          </tr>
                                        </tbody>
                                      </table>
                                      <br>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <br>
            </div>
          </div>
          <br>
          <div class="gmail_quote">
            <div dir="ltr" class="gmail_attr">On Mon, May 17, 2021 at
              2:47 AM Dario <<a href="mailto:dario955i@gmail.com" target="_blank">dario955i@gmail.com</a>>
              wrote:<br>
            </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
              <div dir="auto">Hi,
                <div><br>
                </div>
                <div>I should get some data from a specific field of a
                  specific layer but I’m stuck.</div>
                <div><br>
                </div>
                <div>I’m using “Data Ploty” plug-in and I’d like to
                  customise the colour of the chart using expression. </div>
                <div>As I’m working on layout I can’t see any field into
                  expression menu, so I need to call a specific layer
                  and then the field.</div>
                <div>I’d like to write something like that but, of
                  course, selecting the correct layer:</div>
                <div><br>
                  <span><span style="font-family:"Courier New"">CASE</span></span><br>
                  <span><span style="font-family:"Courier New"">WHEN
                      "Civici" = 'Neri' THEN color_rgb(0,0,0)</span></span><br>
                  <span><span style="font-family:"Courier New"">ELSE
                      color_rgb (255,0,0)</span></span><br>
                  <span><span style="font-family:"Courier New"">END</span></span></div>
                <div><br>
                </div>
                <div><br>
                </div>
                <div>Thank you in advance.</div>
                <div><br>
                </div>
                <div>Cheers</div>
                <div>
                  <div><br>
                    <div dir="ltr">_</div>
                  </div>
                </div>
              </div>
              _______________________________________________<br>
              Qgis-user mailing list<br>
              <a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
              List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
              Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
            </blockquote>
          </div>
        </blockquote>
      </div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
Qgis-user mailing list
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
</pre>
    </blockquote>
  </div>

_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</blockquote></div>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</blockquote></div>
</blockquote></div>
</div></body></html>