Thanks Nyall,
I figured it was that because I could place the string “Length” in a column. I
thought it would work in the field calculator with something like ‘“‘ ||
@thelenghtstring || ‘“‘ but obviously, it does not.
Thank ps for the precision.
Nicolas Cadieux
https://gitlab.com/njacadieux
On Tue, 24 Aug 2021 at 03:53, Charles Dixon-Paver wrote:
>
> Honestly I have no idea
>
> I mean, of course what is happening is QGIS is needing to identify a field
> from a text string, and it's even possible that with some convoluted chain of
> escape characters or funky regex the process
There's some missing spaces in the expression, but I think you got it.
A segunda, 23/08/2021, 23:07, Alexandre Neto
escreveu:
> I am a bit late, and Charles already provided a working solution, but
> don't forget the extremely useful function eval.
>
> The function as is will compare fieldname
I am a bit late, and Charles already provided a working solution, but don't
forget the extremely useful function eval.
The function as is will compare fieldname to fieldname (returning true) and
then try to concatenate the string '2' to it...
@NamelengthField != @NamelengthField || '2'
Try
Honestly I have no idea
I mean, of course what is happening is QGIS is needing to identify a field
from a text string, and it's even possible that with some convoluted chain
of escape characters or funky regex the process could correct itself and
"just work".
In all likelihood you could have
Hi,
if(attribute(to_string( @NamelengthField )) != "LENGTH2", TRUE, FALSE )
("LENGHT2" is an existing field and @NamelengthField was a model input
string.)
This worked for me! If you have the time, please explain why I needed
the _attribute()_ function for this to work. I looked in the
Hi,
I see where this is going. Good idea. I will think more like a python
programmer here. I will test and report back. It may take a few days as I
will simplify the model first and break it down. I might take you up on your
offer for help and share the model and a test file.
Thanks!
Hi Nicholas,
I haven't had time to dig into this extensively or encountered this
particular issue, but I would suggest trying to "force" the expression to
retrieve the correct info regardless of context using something like this:
with_variable('Length2', to_string(@NamelengthField) || '2',
Nicolas,
I have not looked at this in too much detail, but at a quick glance, could it
not be the fact that you should be using the newly created fields? As in
instead of @NamelengthField != @NamelengthField || '2', should it not be more
like your previous example Length != Length2
Regards,
Hi,
Does anyone have an idea?
Nicolas Cadieux
https://gitlab.com/njacadieux
> Le 8 juill. 2021 à 01:17, Nicolas Cadieux a
> écrit :
>
>
> Hi,
>
> I am creating a model that fixes Network files before they are used in the
> QGIS Network analysis (Shortest path) tools.
>
> This is my work
Hi,
I am creating a model that fixes Network files before they are used in
the QGIS Network analysis (Shortest path) tools.
This is my work flow:
1. Create a "Length" field (value) and calculate $length in the field
calculator
2. Split the Multipart lines into Singlepart lines
3. Create a
11 matches
Mail list logo