<?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: Extract a six digit number from a string that also contains other numbers in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Extract-a-six-digit-number-from-a-string-that-also-contains/m-p/1006042#M646180</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks mark, but unfortunately no. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are all kinds of combinations of text and numbers. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need someway of only extracting those numbers found in the string that are exactly 6 numbers long regardless of what is either side of them. (space, underscore etc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I may be getting close with a regex function that I have found but I am still playing with it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will post back if I get it to work. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Nov 2015 09:22:35 GMT</pubDate>
    <dc:creator>canoebi99</dc:creator>
    <dc:date>2015-11-17T09:22:35Z</dc:date>
    <item>
      <title>Extract a six digit number from a string that also contains other numbers</title>
      <link>https://community.qlik.com/t5/QlikView/Extract-a-six-digit-number-from-a-string-that-also-contains/m-p/1006040#M646178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need some assistance from some experts out there! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a string field that contains a job number and I need to extract the job number. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately there are other numbers in the string which complicates things. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example strings that I am working with are below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Microsoft Word - 316680_15196160415_CQP Stage 3_bes&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - I need to extract 316680 from this string&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;12275 151028 Stage 1 2 Post Construction Audit&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - I need to extract 151028 from this string&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;So basically any 6 digit string needs to be extracted. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Does anyone have any ideas as to how I can do this (in the script)? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Many thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Ben&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2015 00:41:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extract-a-six-digit-number-from-a-string-that-also-contains/m-p/1006040#M646178</guid>
      <dc:creator>canoebi99</dc:creator>
      <dc:date>2015-11-17T00:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a six digit number from a string that also contains other numbers</title>
      <link>https://community.qlik.com/t5/QlikView/Extract-a-six-digit-number-from-a-string-that-also-contains/m-p/1006041#M646179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would they always be like the above?&lt;/P&gt;&lt;P&gt;As you could replace space with _ so they are formatted the same and then use subfield&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like SUBFIELD(REPLACE(Field,' ','_'),'_',2) as Extracted?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2015 09:05:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extract-a-six-digit-number-from-a-string-that-also-contains/m-p/1006041#M646179</guid>
      <dc:creator>Mark_Little</dc:creator>
      <dc:date>2015-11-17T09:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a six digit number from a string that also contains other numbers</title>
      <link>https://community.qlik.com/t5/QlikView/Extract-a-six-digit-number-from-a-string-that-also-contains/m-p/1006042#M646180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks mark, but unfortunately no. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are all kinds of combinations of text and numbers. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need someway of only extracting those numbers found in the string that are exactly 6 numbers long regardless of what is either side of them. (space, underscore etc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I may be getting close with a regex function that I have found but I am still playing with it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will post back if I get it to work. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2015 09:22:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extract-a-six-digit-number-from-a-string-that-also-contains/m-p/1006042#M646180</guid>
      <dc:creator>canoebi99</dc:creator>
      <dc:date>2015-11-17T09:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a six digit number from a string that also contains other numbers</title>
      <link>https://community.qlik.com/t5/QlikView/Extract-a-six-digit-number-from-a-string-that-also-contains/m-p/1006043#M646181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here concern is what, you dont have fix format of string&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some where you are having '_', ' ' and may be some other special character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you post some sample data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2015 09:35:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extract-a-six-digit-number-from-a-string-that-also-contains/m-p/1006043#M646181</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-17T09:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a six digit number from a string that also contains other numbers</title>
      <link>https://community.qlik.com/t5/QlikView/Extract-a-six-digit-number-from-a-string-that-also-contains/m-p/1006044#M646182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try something like this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD *, SubField(Replace(&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Field&lt;/SPAN&gt;,' ','_'),'_') as Output Inline [&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Field&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;316680_15196160415_CQP Stage 3_bes&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;12275 151028 Stage 1 2 Post Construction Audit ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inner Join&lt;/P&gt;&lt;P&gt;LOAD Distinct Data,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Output &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where len(Field)=6;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2015 09:40:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extract-a-six-digit-number-from-a-string-that-also-contains/m-p/1006044#M646182</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2015-11-17T09:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a six digit number from a string that also contains other numbers</title>
      <link>https://community.qlik.com/t5/QlikView/Extract-a-six-digit-number-from-a-string-that-also-contains/m-p/1006045#M646183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what if there is two numbers with length six? fro eg. 12 12345 abc 456788&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2015 11:07:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extract-a-six-digit-number-from-a-string-that-also-contains/m-p/1006045#M646183</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2015-11-17T11:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a six digit number from a string that also contains other numbers</title>
      <link>https://community.qlik.com/t5/QlikView/Extract-a-six-digit-number-from-a-string-that-also-contains/m-p/1006046#M646184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ben,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is the code&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14478531660316017" jivemacro_uid="_14478531660316017"&gt;
&lt;P&gt;t0:&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Field&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ,SubField(value, '_') as value&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp; *&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ,SubField(Field, ' ') as value&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;LOAD * Inline [&lt;/P&gt;
&lt;P&gt;Field&lt;/P&gt;
&lt;P&gt;Microsoft Word - 316680_15196160415_CQP Stage 3_bes&lt;/P&gt;
&lt;P&gt;12275 151028 Stage 1 2 Post Construction Audit&lt;/P&gt;
&lt;P&gt;12275 000028 Stage 1 2 Post Construction Audit&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;t1:&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Field&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ,value as OnlyNum&lt;/P&gt;
&lt;P&gt;Resident t0&lt;/P&gt;
&lt;P&gt;Where IsNum(KeepChar(value, '0123456789')) and Len(KeepChar(value, '0123456789')) = 6;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have added a you row with 000028 to test the result of my where condition and is all ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Luca Jonathan Panetta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Nov 2015 13:27:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extract-a-six-digit-number-from-a-string-that-also-contains/m-p/1006046#M646184</guid>
      <dc:creator>pljsoftware</dc:creator>
      <dc:date>2015-11-18T13:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a six digit number from a string that also contains other numbers</title>
      <link>https://community.qlik.com/t5/QlikView/Extract-a-six-digit-number-from-a-string-that-also-contains/m-p/1006047#M646185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This will do the trick;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_1447856474870924 jive_text_macro" jivemacro_uid="_1447856474870924" modifiedtitle="true"&gt;
&lt;P&gt;LOAD *, KeepChar(Mid(SubString,2,6),'0123456789') as Number&lt;/P&gt;
&lt;P&gt;WHERE&lt;/P&gt;
&lt;P&gt;&amp;nbsp; not IsNum(Left(SubString,1))&lt;/P&gt;
&lt;P&gt;&amp;nbsp; and not IsNum(Right(SubString,1))&lt;/P&gt;
&lt;P&gt;&amp;nbsp; and KeepChar(Mid(SubString,2,6),'0123456789') = Mid(SubString,2,6);&lt;/P&gt;
&lt;P&gt;LOAD *, Text(Mid(TestString,IterNo(),8)) as SubString, IterNo() as ID&lt;/P&gt;
&lt;P&gt;While IterNo() &amp;lt;= Length-8;&lt;/P&gt;
&lt;P&gt;LOAD *,'@' &amp;amp; String &amp;amp; '@' as TestString, Len(String)+2 as Length INLINE [&lt;/P&gt;
&lt;P&gt;String&lt;/P&gt;
&lt;P&gt;Microsoft Word - 316680_15196160415_CQP Stage 3_bes&lt;/P&gt;
&lt;P&gt;12275 151028 Stage 1 2 Post Construction Audit &lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Nov 2015 14:23:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extract-a-six-digit-number-from-a-string-that-also-contains/m-p/1006047#M646185</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-11-18T14:23:51Z</dc:date>
    </item>
  </channel>
</rss>

