<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Where condition in script retrieving incorrect result. in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-condition-in-script-retrieving-incorrect-result/m-p/2502007#M14489</link>
    <description>&lt;P&gt;Hello, I am not sure if this is the correct category to post this but here is the issue:&lt;/P&gt;
&lt;P&gt;I might have stumbled upon a bug, if not I would definitely like some help with this.&lt;/P&gt;
&lt;P&gt;I have the following where condition in script:&lt;/P&gt;
&lt;PRE&gt;Where Len(Trim(CODE)) &amp;gt; 3&lt;/PRE&gt;
&lt;P&gt;Now, even though it says larger than 3, the result will always include 1 and exclude 2 and 3 and start from 4 which is the desired result minus the 1 appearing. Even if I try "Where &lt;STRONG&gt;not&lt;/STRONG&gt; Len(Trim(CODE)) &lt;STRONG&gt;&amp;lt;&lt;/STRONG&gt; 3", it will still include 1 and exclude 2 and 3, then start from 4.&lt;/P&gt;
&lt;P&gt;I have also tried "Where Len(Trim(Text(CODE))) &amp;gt; 3" but it does not make a difference.&lt;/P&gt;
&lt;P&gt;Why is 1 always showing up?&lt;/P&gt;
&lt;P&gt;Your assistance is appreciated.&lt;/P&gt;</description>
    <pubDate>Mon, 20 Jan 2025 11:53:38 GMT</pubDate>
    <dc:creator>M_B</dc:creator>
    <dc:date>2025-01-20T11:53:38Z</dc:date>
    <item>
      <title>Where condition in script retrieving incorrect result.</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-condition-in-script-retrieving-incorrect-result/m-p/2502007#M14489</link>
      <description>&lt;P&gt;Hello, I am not sure if this is the correct category to post this but here is the issue:&lt;/P&gt;
&lt;P&gt;I might have stumbled upon a bug, if not I would definitely like some help with this.&lt;/P&gt;
&lt;P&gt;I have the following where condition in script:&lt;/P&gt;
&lt;PRE&gt;Where Len(Trim(CODE)) &amp;gt; 3&lt;/PRE&gt;
&lt;P&gt;Now, even though it says larger than 3, the result will always include 1 and exclude 2 and 3 and start from 4 which is the desired result minus the 1 appearing. Even if I try "Where &lt;STRONG&gt;not&lt;/STRONG&gt; Len(Trim(CODE)) &lt;STRONG&gt;&amp;lt;&lt;/STRONG&gt; 3", it will still include 1 and exclude 2 and 3, then start from 4.&lt;/P&gt;
&lt;P&gt;I have also tried "Where Len(Trim(Text(CODE))) &amp;gt; 3" but it does not make a difference.&lt;/P&gt;
&lt;P&gt;Why is 1 always showing up?&lt;/P&gt;
&lt;P&gt;Your assistance is appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 11:53:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-condition-in-script-retrieving-incorrect-result/m-p/2502007#M14489</guid>
      <dc:creator>M_B</dc:creator>
      <dc:date>2025-01-20T11:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Where condition in script retrieving incorrect result.</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-condition-in-script-retrieving-incorrect-result/m-p/2502022#M14490</link>
      <description>&lt;P&gt;Hi M_B,&lt;/P&gt;
&lt;P&gt;There shouldn't be anything wrong with your where-clause. Would it be possible that you apply the where-clause on a unwanted load-statement which cause then a not expected result?&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Mathias&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 13:10:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-condition-in-script-retrieving-incorrect-result/m-p/2502022#M14490</guid>
      <dc:creator>Mathias_Mols</dc:creator>
      <dc:date>2025-01-20T13:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Where condition in script retrieving incorrect result.</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-condition-in-script-retrieving-incorrect-result/m-p/2502129#M14497</link>
      <description>&lt;P&gt;Hello Mathias,&lt;/P&gt;
&lt;P&gt;There is only 1 load statement reading from a QVD.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 05:26:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-condition-in-script-retrieving-incorrect-result/m-p/2502129#M14497</guid>
      <dc:creator>M_B</dc:creator>
      <dc:date>2025-01-21T05:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: Where condition in script retrieving incorrect result.</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-condition-in-script-retrieving-incorrect-result/m-p/2502130#M14498</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/304935"&gt;@M_B&lt;/a&gt;&amp;nbsp;Please check whether entries in code column are numerical or textual only.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 05:54:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-condition-in-script-retrieving-incorrect-result/m-p/2502130#M14498</guid>
      <dc:creator>Bhushan_Mahajan</dc:creator>
      <dc:date>2025-01-21T05:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Where condition in script retrieving incorrect result.</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-condition-in-script-retrieving-incorrect-result/m-p/2502221#M14499</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/325102"&gt;@Bhushan_Mahajan&lt;/a&gt; The codes are a mix of pure numbers and some mixed with with characters.&lt;/P&gt;
&lt;P&gt;I have just tried to cast the column as text, reloaded the data and stored it into the QVD rewriting it entirely. I reloaded the QVD in the app but the column still does not show any tags when viewing it with the "Data model viewer".&lt;/P&gt;
&lt;P&gt;As you can see in the picture, these codes always show up no matter how I write the where clause.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Code length.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/176685i05BA5505E2337226/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Code length.png" alt="Code length.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 13:16:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-condition-in-script-retrieving-incorrect-result/m-p/2502221#M14499</guid>
      <dc:creator>M_B</dc:creator>
      <dc:date>2025-01-21T13:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Where condition in script retrieving incorrect result.</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-condition-in-script-retrieving-incorrect-result/m-p/2502245#M14500</link>
      <description>&lt;P&gt;It seems that you query the wrong column because&amp;nbsp;&lt;SPAN&gt;CODE &amp;lt;&amp;gt; Code.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 14:48:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-condition-in-script-retrieving-incorrect-result/m-p/2502245#M14500</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2025-01-21T14:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Where condition in script retrieving incorrect result.</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-condition-in-script-retrieving-incorrect-result/m-p/2502324#M14502</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt; the column is just aliased/labeled in the chart. As you can see, the condition is showing a length of 1. What does not show are 2 and 3, then 4 and larger are shown.&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="50%" height="24px"&gt;Code&lt;/TD&gt;
&lt;TD width="50%" height="24px"&gt;Code Length&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="24px"&gt;#&lt;/TD&gt;
&lt;TD width="50%" height="24px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="24px"&gt;#&lt;/TD&gt;
&lt;TD width="50%" height="24px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="24px"&gt;#&lt;/TD&gt;
&lt;TD width="50%" height="24px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="24px"&gt;#&lt;/TD&gt;
&lt;TD width="50%" height="24px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="24px"&gt;####&lt;/TD&gt;
&lt;TD width="50%" height="24px"&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="24px"&gt;####&lt;/TD&gt;
&lt;TD width="50%" height="24px"&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="24px"&gt;####&lt;/TD&gt;
&lt;TD width="50%" height="24px"&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="24px"&gt;#####&lt;/TD&gt;
&lt;TD width="50%" height="24px"&gt;5&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="24px"&gt;######&lt;/TD&gt;
&lt;TD width="50%" height="24px"&gt;6&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The table represents the results I am getting.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 06:09:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-condition-in-script-retrieving-incorrect-result/m-p/2502324#M14502</guid>
      <dc:creator>M_B</dc:creator>
      <dc:date>2025-01-22T06:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Where condition in script retrieving incorrect result.</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-condition-in-script-retrieving-incorrect-result/m-p/2502327#M14503</link>
      <description>&lt;P&gt;I never run into an unexpected behaviour of the functionality of functions like: len(trim()). If they don't return the expected values it's usually the result of unexpected values within the field-values.&lt;/P&gt;
&lt;P&gt;Therefore it's necessary to check them first, for example with additionally functions, like: num/text/isnum/istext/len as well as recno/rowno and to display the result in a table-box. Maybe the cause becomes obvious and if not it would be helpful to export the object as txt-file (not Excel) and then to open it with an editor like Notepad++. The aim is to see all existing chars and not only the visible ones.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 06:32:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-condition-in-script-retrieving-incorrect-result/m-p/2502327#M14503</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2025-01-22T06:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Where condition in script retrieving incorrect result.</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-condition-in-script-retrieving-incorrect-result/m-p/2503429#M14525</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Just to update this, I managed to fix the result. It was a logical error. There were two other conditions with an "or" that I isolated with parenthesis that were causing this behavior.&lt;/P&gt;
&lt;P&gt;Where Len(Trim(CODE)) &amp;gt; 3 and (condition1 and condition2) or (condition1.1 and condition 2.1) and condtion3&lt;/P&gt;
&lt;P&gt;changed to&lt;/P&gt;
&lt;P&gt;Where Len(Trim(CODE)) &amp;gt; 3 and &lt;STRONG&gt;(&lt;/STRONG&gt;(condition1 and condition2) or (condition1.1 and condition 2.1)&lt;STRONG&gt;)&lt;/STRONG&gt; and condtion3&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2025 07:16:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-condition-in-script-retrieving-incorrect-result/m-p/2503429#M14525</guid>
      <dc:creator>M_B</dc:creator>
      <dc:date>2025-01-29T07:16:02Z</dc:date>
    </item>
  </channel>
</rss>

