<?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: Grab a number from a text string in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Grab-a-number-from-a-text-string/m-p/1868826#M1216470</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;as a front end expression implementing all your conditions might be impractical, I would suggest extracting these numbers in the script, e.g. like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarcoWedel_0-1639084028065.png" style="width: 791px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/68308i4828838111B0F9F1/image-size/large?v=v2&amp;amp;px=999" role="button" title="MarcoWedel_0-1639084028065.png" alt="MarcoWedel_0-1639084028065.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;mapNumLet:
Mapping
LOAD Chr(RecNo()), If(IsNum(Chr(RecNo())),'0','_')
AutoGenerate 65535;

tabBillReqText:
LOAD *,
     MapSubString('mapNumLet',BillReqText) as BillReqTextFormat 
Inline [
    BillReqText
    PLRF32444EEEEEC - rrr tell REGDD 1L NBC HFSS
    Need this NUMBER 62467
    Need this NUMBER 52467
    2 INVOICED 08/10 - ADD 3 CHARGED 01/12 - TOTAL 5
    PO 17222798/OJDDDW
    another number 44444 amidst some text
    one number at the end 98765
    Same number in different text 98765
    55555 number at the beginning
    two numbers 56788 in one 56789 text?
    oops 1234 only 4 digits
    12345 is too small
    66666 starts with 6
    no number here
];

tabBillReqTextNum:
LOAD *
Where BillReqNum &amp;gt;= 40000 and not BillReqNum like '6*';
LOAD BillReqText,
     Mid(BillReqText,Index('_'&amp;amp;BillReqTextFormat&amp;amp;'_','_00000_',IterNo()),5) as BillReqNum,
     IterNo() as BillReqNumSeq
Resident tabBillReqText
While IterNo() &amp;lt;= SubStringCount('_'&amp;amp;BillReqTextFormat&amp;amp;'_','_00000_');&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hope this helps&lt;/P&gt;
&lt;P&gt;Marco&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Dec 2021 21:10:18 GMT</pubDate>
    <dc:creator>MarcoWedel</dc:creator>
    <dc:date>2021-12-09T21:10:18Z</dc:date>
    <item>
      <title>Grab a number from a text string</title>
      <link>https://community.qlik.com/t5/QlikView/Grab-a-number-from-a-text-string/m-p/1868211#M1216440</link>
      <description>&lt;P&gt;Field Name = BillReqText&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the text string that changes from the field&amp;nbsp;BillReqText.&lt;/P&gt;
&lt;P&gt;I wish to grab the 5 digit number (62467) which also changes however will always be 5 digits and may not start with a 6 however will not start with anything lower than 4.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"PLRF32444EEEEEC - rrr tell REGDD 1L NBC HFSS&lt;/P&gt;
&lt;P&gt;Need this NUMBER 62467&lt;/P&gt;
&lt;P&gt;2 INVOICED 08/10 - ADD 3 CHARGED 01/12 - TOTAL 5&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PO 17222798/OJDDDW"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks Brett&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 16:15:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Grab-a-number-from-a-text-string/m-p/1868211#M1216440</guid>
      <dc:creator>bnelson111</dc:creator>
      <dc:date>2021-12-08T16:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Grab a number from a text string</title>
      <link>https://community.qlik.com/t5/QlikView/Grab-a-number-from-a-text-string/m-p/1868374#M1216445</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;Subfield(TextBetween(BillReqText, 'NUMBER ', 'INVOICED'), ' ', 1)&lt;/P&gt;&lt;P&gt;Which is searching for the text between NUMBER and INVOICED and then only taking the first part before the space.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 23:10:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Grab-a-number-from-a-text-string/m-p/1868374#M1216445</guid>
      <dc:creator>Lisa_P</dc:creator>
      <dc:date>2021-12-08T23:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Grab a number from a text string</title>
      <link>https://community.qlik.com/t5/QlikView/Grab-a-number-from-a-text-string/m-p/1868826#M1216470</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;as a front end expression implementing all your conditions might be impractical, I would suggest extracting these numbers in the script, e.g. like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarcoWedel_0-1639084028065.png" style="width: 791px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/68308i4828838111B0F9F1/image-size/large?v=v2&amp;amp;px=999" role="button" title="MarcoWedel_0-1639084028065.png" alt="MarcoWedel_0-1639084028065.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;mapNumLet:
Mapping
LOAD Chr(RecNo()), If(IsNum(Chr(RecNo())),'0','_')
AutoGenerate 65535;

tabBillReqText:
LOAD *,
     MapSubString('mapNumLet',BillReqText) as BillReqTextFormat 
Inline [
    BillReqText
    PLRF32444EEEEEC - rrr tell REGDD 1L NBC HFSS
    Need this NUMBER 62467
    Need this NUMBER 52467
    2 INVOICED 08/10 - ADD 3 CHARGED 01/12 - TOTAL 5
    PO 17222798/OJDDDW
    another number 44444 amidst some text
    one number at the end 98765
    Same number in different text 98765
    55555 number at the beginning
    two numbers 56788 in one 56789 text?
    oops 1234 only 4 digits
    12345 is too small
    66666 starts with 6
    no number here
];

tabBillReqTextNum:
LOAD *
Where BillReqNum &amp;gt;= 40000 and not BillReqNum like '6*';
LOAD BillReqText,
     Mid(BillReqText,Index('_'&amp;amp;BillReqTextFormat&amp;amp;'_','_00000_',IterNo()),5) as BillReqNum,
     IterNo() as BillReqNumSeq
Resident tabBillReqText
While IterNo() &amp;lt;= SubStringCount('_'&amp;amp;BillReqTextFormat&amp;amp;'_','_00000_');&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hope this helps&lt;/P&gt;
&lt;P&gt;Marco&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 21:10:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Grab-a-number-from-a-text-string/m-p/1868826#M1216470</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2021-12-09T21:10:18Z</dc:date>
    </item>
  </channel>
</rss>

