Re: [Qgis-user] Select data from a specific layer

2021-05-18 Thread Dario




I try to answer without attached images (size limit)...

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.

I tried also with 'Colore' instead of "Colore", but nothing change.

Here the code:

CASE
When
get_feature('V_TB_ATTIVITA_PT_NR','Colore','N')='N' then color_rgb (0,0,0)
When
get_feature('V_TB_ATTIVITA_PT_NR','Colore','R')='R' then color_rgb (255,0,0)
END

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 :(

Cheers

Il giorno mar 18 mag 2021 alle ore 08:39 Dario C  ha 
scritto:
> 
> 
> 
> 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.
> 
> I tried also with 'Colore' instead of "Colore", but nothing change.
> 
> Here the code:
> 
> CASE
> When
> get_feature('V_TB_ATTIVITA_PT_NR','Colore','N')='N' then color_rgb (0,0,0)
> When
> get_feature('V_TB_ATTIVITA_PT_NR','Colore','R')='R' then color_rgb (255,0,0)
> END
> 
> 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 :(
> 
> Cheers
> 
> Il giorno mar 18 mag 2021 alle ore 08:32 Ujaval Gandhi 
>  ha scritto:
>> 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. 
>> 
>>  
>> Ujaval Gandhi
>> Spatial Thoughts
>> mobile: +91-8095684687
>> email: uja...@spatialthoughts.com
>> 
>> 
>> 
>> 
>> On Tue, May 18, 2021 at 4:35 AM Delaz J  wrote:
>>> Hi Dario,
>>> 
>>> Could you try with 'Colore' and not "Colore" (pay attention to the simple 
>>> vs double quotes)?
>>> 
>>> Regards,
>>> 
>>> Harrissou
>>> 
>>> Le 18/05/2021 à 00:41, Dario C a écrit :
   Hi, thank you for your reply, but I still don't understand how to do... 
 sorry
 
 i tried to write this code in colour expression, but I don't understand 
 what "value" is in get_feature :
 
 CASE
 When
 get_feature('V_TB_ATTIVITA_PT_NR',"Colore",'N')='N' then color_rgb (0,0,0)
 When
 get_feature('V_TB_ATTIVITA_PT_NR',"Colore",'R')='R' then color_rgb 
 (255,0,0)
 END
 
 Consider that I have a virtual field called "Colore" where I have 'N' or 
 'R' in case it is black or red color.
 
 Thank you for your kind availability.
 
 cheers
 
 Il giorno lun 17 mag 2021 alle ore 09:09 Ujaval Gandhi 
  ha scritto:
> You can select the layer under 'Plot Parameters' and its attributes will 
> be available in the expression. (see attached screenshot).
> 
> 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.
>   
> Ujaval Gandhi
> Spatial Thoughts
> mobile: +91-8095684687
> email: uja...@spatialthoughts.com
> 
> 
> 
> 
> 
> On Mon, May 17, 2021 at 2:47 AM Dario  wrote:
>> Hi,
>> 
>> I should get some data from a specific field of a specific layer but I’m 
>> stuck.
>> 
>> I’m using “Data Ploty” plug-in and I’d like to customise the colour of 
>> the chart using expression. 
>> 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.
>> I’d like to write something like that but, of course, selecting the 
>> correct layer:
>> 
>> CASE
>> WHEN "Civici" = 'Neri' THEN color_rgb(0,0,0)
>> ELSE color_rgb (255,0,0)
>> END
>> 
>> 
>> Thank you in advance.
>> 
>> Cheers
>> 
>> _
>> ___
>> Qgis-user mailing list
>> Qgis-user@lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
 
 
 ___
 Qgis-user mailing list
 Qgis-user@lists.osgeo.org
 List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
 Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>> ___
>>> Qgis-user mailing list
>>> Qgis-user@lists.osgeo.org
>>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>> Unsubscribe: 

Re: [Qgis-user] Select data from a specific layer

2021-05-18 Thread Ujaval Gandhi
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.

[image: Logo] 
Ujaval Gandhi
Spatial Thoughts
mobile: +91-8095684687
email: uja...@spatialthoughts.com
[image: LinkedIn icon]   [image:
Twitter icon] 



On Tue, May 18, 2021 at 4:35 AM Delaz J  wrote:

> Hi Dario,
>
> Could you try with 'Colore' and not "Colore" (pay attention to the simple
> vs double quotes)?
>
> Regards,
>
> Harrissou
> Le 18/05/2021 à 00:41, Dario C a écrit :
>
>   Hi, thank you for your reply, but I still don't understand how to do...
> sorry
>
> i tried to write this code in colour expression, but I don't understand
> what "value" is in get_feature :
>
> CASE
> When
> get_feature('V_TB_ATTIVITA_PT_NR',"Colore",'N')='N' then color_rgb (0,0,0)
> When
> get_feature('V_TB_ATTIVITA_PT_NR',"Colore",'R')='R' then color_rgb
> (255,0,0)
> END
>
> Consider that I have a virtual field called "Colore" where I have 'N' or
> 'R' in case it is black or red color.
>
> Thank you for your kind availability.
>
> cheers
>
> Il giorno lun 17 mag 2021 alle ore 09:09 Ujaval Gandhi <
> uja...@spatialthoughts.com> ha scritto:
>
>> You can select the layer under 'Plot Parameters' and its attributes will
>> be available in the expression. (see attached screenshot).
>>
>> 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.
>> [image: Logo] 
>> Ujaval Gandhi
>> Spatial Thoughts
>> mobile: +91-8095684687
>> email: uja...@spatialthoughts.com
>> [image: LinkedIn icon]   
>> [image:
>> Twitter icon] 
>>
>>
>>
>>
>> On Mon, May 17, 2021 at 2:47 AM Dario  wrote:
>>
>>> Hi,
>>>
>>> I should get some data from a specific field of a specific layer but I’m
>>> stuck.
>>>
>>> I’m using “Data Ploty” plug-in and I’d like to customise the colour of
>>> the chart using expression.
>>> 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.
>>> I’d like to write something like that but, of course, selecting the
>>> correct layer:
>>>
>>> CASE
>>> WHEN "Civici" = 'Neri' THEN color_rgb(0,0,0)
>>> ELSE color_rgb (255,0,0)
>>> END
>>>
>>>
>>> Thank you in advance.
>>>
>>> Cheers
>>>
>>> _
>>> ___
>>> Qgis-user mailing list
>>> Qgis-user@lists.osgeo.org
>>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>>
>>
> ___
> Qgis-user mailing listqgis-u...@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Select data from a specific layer

2021-05-17 Thread Delaz J

Hi Dario,

Could you try with 'Colore' and not "Colore" (pay attention to the 
simple vs double quotes)?


Regards,

Harrissou

Le 18/05/2021 à 00:41, Dario C a écrit :
  Hi, thank you for your reply, but I still don't understand how to 
do... sorry


i tried to write this code in colour expression, but I don't 
understand what "value" is in get_feature :


CASE
When
get_feature('V_TB_ATTIVITA_PT_NR',"Colore",'N')='N' then color_rgb (0,0,0)
When
get_feature('V_TB_ATTIVITA_PT_NR',"Colore",'R')='R' then color_rgb 
(255,0,0)

END

Consider that I have a virtual field called "Colore" where I have 'N' 
or 'R' in case it is black or red color.


Thank you for your kind availability.

cheers

Il giorno lun 17 mag 2021 alle ore 09:09 Ujaval Gandhi 
mailto:uja...@spatialthoughts.com>> ha 
scritto:


You can select the layer under 'Plot Parameters' and its
attributes will be available in the expression. (see attached
screenshot).

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.
Logo    
Ujaval Gandhi
Spatial Thoughts
mobile: +91-8095684687
email: uja...@spatialthoughts.com 
LinkedIn icon 
Twitter icon 





On Mon, May 17, 2021 at 2:47 AM Dario mailto:dario9...@gmail.com>> wrote:

Hi,

I should get some data from a specific field of a specific
layer but I’m stuck.

I’m using “Data Ploty” plug-in and I’d like to customise the
colour of the chart using expression.
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.
I’d like to write something like that but, of course,
selecting the correct layer:

CASE
WHEN "Civici" = 'Neri' THEN color_rgb(0,0,0)
ELSE color_rgb (255,0,0)
END


Thank you in advance.

Cheers

_
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org 
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user

Unsubscribe:
https://lists.osgeo.org/mailman/listinfo/qgis-user



___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Select data from a specific layer

2021-05-17 Thread Dario C
  Hi, thank you for your reply, but I still don't understand how to do...
sorry

i tried to write this code in colour expression, but I don't understand
what "value" is in get_feature :

CASE
When
get_feature('V_TB_ATTIVITA_PT_NR',"Colore",'N')='N' then color_rgb (0,0,0)
When
get_feature('V_TB_ATTIVITA_PT_NR',"Colore",'R')='R' then color_rgb (255,0,0)
END

Consider that I have a virtual field called "Colore" where I have 'N' or
'R' in case it is black or red color.

Thank you for your kind availability.

cheers

Il giorno lun 17 mag 2021 alle ore 09:09 Ujaval Gandhi <
uja...@spatialthoughts.com> ha scritto:

> You can select the layer under 'Plot Parameters' and its attributes will
> be available in the expression. (see attached screenshot).
>
> 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.
> [image: Logo] 
> Ujaval Gandhi
> Spatial Thoughts
> mobile: +91-8095684687
> email: uja...@spatialthoughts.com
> [image: LinkedIn icon]   [image:
> Twitter icon] 
>
>
>
> On Mon, May 17, 2021 at 2:47 AM Dario  wrote:
>
>> Hi,
>>
>> I should get some data from a specific field of a specific layer but I’m
>> stuck.
>>
>> I’m using “Data Ploty” plug-in and I’d like to customise the colour of
>> the chart using expression.
>> 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.
>> I’d like to write something like that but, of course, selecting the
>> correct layer:
>>
>> CASE
>> WHEN "Civici" = 'Neri' THEN color_rgb(0,0,0)
>> ELSE color_rgb (255,0,0)
>> END
>>
>>
>> Thank you in advance.
>>
>> Cheers
>>
>> _
>> ___
>> Qgis-user mailing list
>> Qgis-user@lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


[Qgis-user] Select data from a specific layer

2021-05-16 Thread Dario
Hi,

I should get some data from a specific field of a specific layer but I’m stuck.

I’m using “Data Ploty” plug-in and I’d like to customise the colour of the 
chart using expression. 
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.
I’d like to write something like that but, of course, selecting the correct 
layer:

CASE
WHEN "Civici" = 'Neri' THEN color_rgb(0,0,0)
ELSE color_rgb (255,0,0)
END


Thank you in advance.

Cheers


Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user