<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle22
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:560093308;
        mso-list-template-ids:-1773135750;}
@list l1
        {mso-list-id:636185142;
        mso-list-template-ids:-661999404;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-IE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Nicolas,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">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 </span><b>@NamelengthField != @NamelengthField || '2'</b>,
<span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">
should it not be more like your previous example</span> <b>Length != Length2</b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Richard<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<table style="FONT-SIZE: 9pt; HEIGHT: 321px; FONT-FAMILY: Arial, sans-serif; WIDTH: 500px; LINE-HEIGHT: 15px" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="FONT-SIZE: 9pt; FONT-FAMILY: Arial,sans-serif; WIDTH: 500px; COLOR: #004d44; PADDING-BOTTOM: 6px">
<span style="FONT-FAMILY: Arial, sans-serif; FONT-WEIGHT: bold; COLOR: #004d44"><br>
——</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; FONT-WEIGHT: bold; COLOR: #004d44">Richard McDonnell MSc GIS, FME Certified Professional</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #004d44"><i>FRM Data Management</i></span><br>
<br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #004d44">——</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; FONT-WEIGHT: bold; COLOR: #004d44">Oifig na nOibreacha Poiblí</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #004d44">Office of Public Works</span><br>
<br>
<span style="FONT-FAMILY: Arial, sans-serif; FONT-WEIGHT: bold; COLOR: #565148">Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #565148">Jonathan Swift Street, Trim, Co Meath, C15 NX36</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #565148">——</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #565148">M +353 87 688 5964 T +353 46 942 2409</span><br>
<a href="https://gov.ie/opw">https://gov.ie/opw</a><br>
<br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #004d44">——<br>
To send me files larger than 30MB, please use the link below https://filetransfer.opw.ie/filedrop/richard.mcdonnell@opw.ie<br>
</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #004d44">Email Disclaimer: https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/
</span></td>
</tr>
</tbody>
</table>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Qgis-user <qgis-user-bounces@lists.osgeo.org>
<b>On Behalf Of </b>Nicolas Cadieux<br>
<b>Sent:</b> 20 July 2021 09:27<br>
<b>To:</b> Qgis Users List <qgis-user@lists.osgeo.org><br>
<b>Subject:</b> Re: [Qgis-user] Problem using Model Inputs variable in an Select by expression in the model Designer<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Does anyone have an idea?<o:p></o:p></p>
<div>
<p class="MsoNormal">Nicolas Cadieux<o:p></o:p></p>
<div>
<p class="MsoNormal"><a href="https://gitlab.com/njacadieux">https://gitlab.com/njacadieux</a><o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-bottom:12.0pt">Le 8 juill. 2021 à 01:17, Nicolas Cadieux <<a href="mailto:njacadieux.gitlab@gmail.com">njacadieux.gitlab@gmail.com</a>> a écrit :<o:p></o:p></p>
</blockquote>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal"><span style="font-family:"Tahoma",sans-serif"></span> <o:p>
</o:p></p>
<p>Hi,<o:p></o:p></p>
<p>I am creating a model that fixes Network files before they are used in the QGIS Network analysis (Shortest path) tools.<o:p></o:p></p>
<p>This is my work flow:<o:p></o:p></p>
<ol start="1" type="1">
<li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l1 level1 lfo1">
Create a "Length" field (value) and calculate $length in the field calculator<o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l1 level1 lfo1">
Split the Multipart lines into Singlepart lines<o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l1 level1 lfo1">
Create a "Length<b>2</b>" field (value) and calculate $length in the field calculator<o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l1 level1 lfo1">
Select by expression Length != Length2.  This basically gives me a selection of line that have been modified by the Multipart to Singlepart algorithm. (I get 8 results)<o:p></o:p></li></ol>
<p>This works well<o:p></o:p></p>
<p>The problem is when I create and Input String to let the user create a "Length" field.  This become a variable called @NamelengthField. My work flow become:<o:p></o:p></p>
<ol start="1" type="1">
<li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo2">
User input "Length" in the Model input. (@NamelengthField)<o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo2">
Create a "Length" field using  @NamelengthField (as pre-calculated value) and calculate $length in the field calculator: This is OK<o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo2">
Split the Multipart lines into Singlepart lines: This is OK<o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo2">
Create a "Length2" field using  @NamelengthField ||'2'  (as pre-calculated value) and calculate $length in the field calculator: This is OK this field (Length2) is created and calculated properly.
<o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo2">
I get stuck  when I try Select by expression using  @NamelengthField != @NamelengthField || '2' (as pre-calculated value) (I get all lines back) and the test does not work.<o:p></o:p></li></ol>
<p>I tried stuff like<o:p></o:p></p>
<p>@NamelengthField != (@NamelengthField || '2')<o:p></o:p></p>
<p>'@NamelengthField != @NamelengthField || '2''<o:p></o:p></p>
<p>"@NamelengthField != @NamelengthField || '2'"<o:p></o:p></p>
<p>"@NamelengthField"|| !=|| "@NamelengthField || '2'"<o:p></o:p></p>
<p>Even simple @NamelengthField = 5.286365157529550 (which should extract exactly one value). 
<o:p></o:p></p>
<p>Any ideas?<o:p></o:p></p>
<p>Nicolas<o:p></o:p></p>
<p>QGIS 3.18.2 on Windows 10 <o:p></o:p></p>
<p><o:p> </o:p></p>
<p><o:p> </o:p></p>
<p><o:p> </o:p></p>
<pre>-- <o:p></o:p></pre>
<pre>Nicolas Cadieux<o:p></o:p></pre>
<pre><a href="https://gitlab.com/njacadieux">https://gitlab.com/njacadieux</a><o:p></o:p></pre>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>