<?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 Re: Load script remove rows based on containing character in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-script-remove-rows-based-on-containing-character/m-p/1829361#M1214306</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try with &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/146877"&gt;@Andrei_Cusnir&lt;/a&gt;&amp;nbsp; approach or, instead of resident load, you can use preceding load also like below&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;temp:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load * where wildmatch(substring, &amp;nbsp;'*€*') &amp;gt; 0;&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;load field1,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'Sub'&amp;amp;Autonumber(RowNo(),RecNo()) as ColNo,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SubField(text,'//') as substring&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;resident Bron;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Aug 2021 10:31:51 GMT</pubDate>
    <dc:creator>MayilVahanan</dc:creator>
    <dc:date>2021-08-18T10:31:51Z</dc:date>
    <item>
      <title>Load script remove rows based on containing character</title>
      <link>https://community.qlik.com/t5/QlikView/Load-script-remove-rows-based-on-containing-character/m-p/1828818#M1214233</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have the below load script.&lt;BR /&gt;In the original table (bron) is a field named 'text' which contains a lot of information.&lt;BR /&gt;I replaced the line feeds with the character '//' and made in a second table a new row for each part of the string.&lt;/P&gt;&lt;P&gt;Now some of these new rows (called substring) contain the character '€' and some don't.&lt;BR /&gt;I would like to only load the rows which contain a € into my QlikView file.&lt;BR /&gt;Can anyone help me with a correct syntax for this?&lt;/P&gt;&lt;P&gt;Bron:&lt;BR /&gt;SELECT&lt;BR /&gt;field1,&lt;BR /&gt;REPLACE(REPLACE(text, CHAR(13), '//'), CHAR(10), '//') as text&lt;BR /&gt;FROM ....&lt;/P&gt;&lt;P&gt;temp:&lt;BR /&gt;load field1,&lt;BR /&gt;'Sub'&amp;amp;Autonumber(RowNo(),RecNo()) as ColNo,&lt;BR /&gt;SubField(text,'//') as substring&lt;BR /&gt;resident Bron;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Aug 2021 13:31:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-script-remove-rows-based-on-containing-character/m-p/1828818#M1214233</guid>
      <dc:creator>Strooprover</dc:creator>
      <dc:date>2021-08-16T13:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Load script remove rows based on containing character</title>
      <link>https://community.qlik.com/t5/QlikView/Load-script-remove-rows-based-on-containing-character/m-p/1829357#M1214305</link>
      <description>&lt;P&gt;Hello, if my&amp;nbsp;understanding, of your use case scenario, is correct, then you are trying to achieve something like this:&lt;/P&gt;

&lt;OL&gt;
 &lt;LI&gt;I am going to skip the first LOAD statement as it is simply taking the text field and replaces all the line feeds with &lt;STRONG&gt;'//'&lt;/STRONG&gt; characters&lt;/LI&gt;
 &lt;LI&gt;After the first load statement, you have a data set looking like this:&lt;/LI&gt;
 &lt;LI&gt;&lt;IMG src="https://lithium-response-prod.s3.us-west-2.amazonaws.com/qlik.response.lithium.com/RESPONSEIMAGE/122c5916-5a34-4d8f-8f96-10cc665d4990.default.PNG" /&gt;&lt;/LI&gt;
 &lt;LI&gt;However, when you LOAD the second statement in QlikView, you are getting the following outcome:&lt;IMG src="https://lithium-response-prod.s3.us-west-2.amazonaws.com/qlik.response.lithium.com/RESPONSEIMAGE/f3303904-cb61-4ae3-aee0-827c86e8826c.default.PNG" /&gt;&lt;/LI&gt;
 &lt;LI&gt;And the issue here is that some of the records don't have the&amp;nbsp;€ symbol and you would like to remove them.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;If my understanding was correct, there are 2 possible solutions to this issue:&lt;/P&gt;

&lt;UL&gt;
 &lt;LI&gt;&lt;SPAN style="color:#27ae60"&gt;&lt;STRONG&gt;Solution A:&lt;/STRONG&gt;&lt;/SPAN&gt;

 &lt;UL&gt;
  &lt;LI&gt;Modify the second LOAD statement to look like this:&lt;/LI&gt;
 &lt;/UL&gt;
 &lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Temp:&lt;BR /&gt;
&amp;nbsp; &amp;nbsp; LOAD Data,&lt;BR /&gt;
&amp;nbsp; &amp;nbsp; 'Sub' &amp;amp; Autonumber(RowNo()&amp;amp;RecNo()) as ColNo,&lt;BR /&gt;
&amp;nbsp; &amp;nbsp; SubField(Data,'//', &lt;SPAN style="color:#2ecc71"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;) as substring&lt;BR /&gt;
Resident Table1;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;As you can see I have added the number &lt;STRONG&gt;2&lt;/STRONG&gt; as the third argument in the function &lt;SPAN style="color:#27ae60"&gt;&lt;STRONG&gt;SubField(...)&lt;/STRONG&gt;&lt;/SPAN&gt;. The &lt;STRONG&gt;&lt;SPAN style="color:#27ae60"&gt;SubField(...)&lt;/SPAN&gt;&lt;/STRONG&gt; function will break the string into multiple parts by using '//' as delimiter and will take the 2nd part only. So the results after the load is complete will be:&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://lithium-response-prod.s3.us-west-2.amazonaws.com/qlik.response.lithium.com/RESPONSEIMAGE/0625da99-9a90-4829-ae58-f8b327a3e7e2.default.PNG" /&gt;&lt;/P&gt;

&lt;P&gt;As you can see only the records that contain&amp;nbsp;&lt;STRONG&gt;€&lt;/STRONG&gt; symbol under &lt;STRONG&gt;substring &lt;/STRONG&gt;field are loaded. However, this solution is only ideal under the&amp;nbsp;following circumstances:&lt;/P&gt;

&lt;UL&gt;
 &lt;LI&gt;Format of the original data is [DATA]//€[Number]&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;This will NOT work under other circumstances, such as:&lt;/P&gt;

&lt;UL&gt;
 &lt;LI&gt;Format of the original data [DATA]//[DATA]//€[Number]&lt;/LI&gt;
 &lt;LI&gt;Format of the original data [DATA]//€[Number]//€[Number]//€[Number]&lt;/LI&gt;
 &lt;LI&gt;etc.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Therefore there is another solution for this issue, which is:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;UL&gt;
 &lt;LI&gt;&lt;SPAN style="color:#27ae60"&gt;&lt;STRONG&gt;Solution B:&lt;/STRONG&gt;&lt;/SPAN&gt;

 &lt;UL&gt;
  &lt;LI&gt;Add another &lt;STRONG&gt;temp load statement &lt;/STRONG&gt;that will load only the records with&amp;nbsp;&lt;STRONG&gt;€&lt;/STRONG&gt; from the &lt;STRONG&gt;previous loaded data &lt;/STRONG&gt;and then &lt;STRONG&gt;drop the old temp table&lt;/STRONG&gt;.&lt;/LI&gt;
 &lt;/UL&gt;
 &lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;The new statements should look like this:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Temp:&lt;BR /&gt;
&amp;nbsp; &amp;nbsp; LOAD Data,&lt;BR /&gt;
&amp;nbsp; &amp;nbsp; 'Sub' &amp;amp; Autonumber(RowNo()&amp;amp;RecNo()) as ColNo,&lt;BR /&gt;
&amp;nbsp; &amp;nbsp; SubField(Data,'//') as substring&lt;BR /&gt;
Resident Table1;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Temp2:&lt;BR /&gt;
Noconcatenate&lt;BR /&gt;
LOAD&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; Data,&lt;BR /&gt;
&amp;nbsp; &amp;nbsp; ColNo,&lt;BR /&gt;
&amp;nbsp; &amp;nbsp; substring&lt;BR /&gt;
Resident Temp&lt;BR /&gt;
WHERE WildMatch(substring, '*€*') &amp;gt; 0;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;DROP Table Temp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;UL&gt;
 &lt;LI&gt;The second LOAD statement stays as it is.&lt;/LI&gt;
 &lt;LI&gt;You add another LOAD statement, to load the data from the first&amp;nbsp;&lt;STRONG&gt;Temp&amp;nbsp;&lt;/STRONG&gt;table but only where the &lt;STRONG&gt;substring &lt;/STRONG&gt;field contains&amp;nbsp;&lt;STRONG&gt;€&amp;nbsp;&lt;/STRONG&gt;symbol.&amp;nbsp;&lt;/LI&gt;
 &lt;LI&gt;Then you have to drop the first&amp;nbsp;&lt;STRONG&gt;Temp&amp;nbsp;&lt;/STRONG&gt;table to avoid having your memory overloaded.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;This will have the following result:&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://lithium-response-prod.s3.us-west-2.amazonaws.com/qlik.response.lithium.com/RESPONSEIMAGE/87118df9-7bbf-4907-a7ac-1065160d3e92.default.PNG" /&gt;&lt;/P&gt;

&lt;P&gt;As you can see, you are left with &lt;STRONG&gt;Temp2 &lt;/STRONG&gt;table that only contains records where substring has&lt;STRONG&gt;&amp;nbsp;€&lt;/STRONG&gt; symbol&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I hope that this information has helped you resolve the issue.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 10:15:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-script-remove-rows-based-on-containing-character/m-p/1829357#M1214305</guid>
      <dc:creator>Andrei_Cusnir</dc:creator>
      <dc:date>2021-08-18T10:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Load script remove rows based on containing character</title>
      <link>https://community.qlik.com/t5/QlikView/Load-script-remove-rows-based-on-containing-character/m-p/1829361#M1214306</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try with &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/146877"&gt;@Andrei_Cusnir&lt;/a&gt;&amp;nbsp; approach or, instead of resident load, you can use preceding load also like below&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;temp:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load * where wildmatch(substring, &amp;nbsp;'*€*') &amp;gt; 0;&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;load field1,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'Sub'&amp;amp;Autonumber(RowNo(),RecNo()) as ColNo,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SubField(text,'//') as substring&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;resident Bron;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 10:31:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-script-remove-rows-based-on-containing-character/m-p/1829361#M1214306</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2021-08-18T10:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Load script remove rows based on containing character</title>
      <link>https://community.qlik.com/t5/QlikView/Load-script-remove-rows-based-on-containing-character/m-p/1829643#M1214351</link>
      <description>&lt;P&gt;Thank you very much for your very comprehensive example.&lt;BR /&gt;It works like a charm!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 07:33:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-script-remove-rows-based-on-containing-character/m-p/1829643#M1214351</guid>
      <dc:creator>Strooprover</dc:creator>
      <dc:date>2021-08-19T07:33:04Z</dc:date>
    </item>
  </channel>
</rss>

