Re: [Qgis-user] Problem using Model Inputs variable in an Select by expression in the model Designer

2021-08-23 Thread Nicolas Cadieux
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

Re: [Qgis-user] Problem using Model Inputs variable in an Select by expression in the model Designer

2021-08-23 Thread Nyall Dawson
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

Re: [Qgis-user] Problem using Model Inputs variable in an Select by expression in the model Designer

2021-08-23 Thread Alexandre Neto
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

Re: [Qgis-user] Problem using Model Inputs variable in an Select by expression in the model Designer

2021-08-23 Thread Alexandre Neto
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

Re: [Qgis-user] Problem using Model Inputs variable in an Select by expression in the model Designer

2021-08-23 Thread Charles Dixon-Paver
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

Re: [Qgis-user] Problem using Model Inputs variable in an Select by expression in the model Designer

2021-08-23 Thread Nicolas Cadieux
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

Re: [Qgis-user] Problem using Model Inputs variable in an Select by expression in the model Designer

2021-07-20 Thread Nicolas Cadieux
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!

Re: [Qgis-user] Problem using Model Inputs variable in an Select by expression in the model Designer

2021-07-20 Thread Charles Dixon-Paver
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',

Re: [Qgis-user] Problem using Model Inputs variable in an Select by expression in the model Designer

2021-07-20 Thread Richard McDonnell
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,

Re: [Qgis-user] Problem using Model Inputs variable in an Select by expression in the model Designer

2021-07-20 Thread Nicolas Cadieux
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