<?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: Return substring from Field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997923#M949521</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;keepchar(field name,'0123456789') as newfiled&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Dec 2015 08:11:19 GMT</pubDate>
    <dc:creator>arulsettu</dc:creator>
    <dc:date>2015-12-11T08:11:19Z</dc:date>
    <item>
      <title>Return substring from Field</title>
      <link>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997921#M949519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222426; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt;I'm trying to find a way to extract account numbers from a field that can contain additional information. An account number will always start with an "A" or a "U" and then have 6 numbers, e.g. A123456 or U654321.&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222426; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt;A field can have just the account number, or it can have additional data, e.g. "ADT CASH DEPOSIT A235999" or "FNB APP PAYMENT FROM A230275" - the account number can be on it's own, orat the beginning, middle or end of the string.&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222426; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222426; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt;I have a function in Excel to do this but not sure how to approach it in Qlikview - want to do this in the load script and then create a new field with the extracted value, e.g:&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222426; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt;LOAD &lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222426; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt;[Original Field],&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222426; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt;"substring from field" as [New Filed]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 08:01:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997921#M949519</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2015-12-11T08:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Return substring from Field</title>
      <link>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997922#M949520</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;hope this heps u&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/message/827863#827863" title="https://community.qlik.com/message/827863#827863"&gt;https://community.qlik.com/message/827863#827863&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 08:07:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997922#M949520</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2015-12-11T08:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: Return substring from Field</title>
      <link>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997923#M949521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;keepchar(field name,'0123456789') as newfiled&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 08:11:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997923#M949521</guid>
      <dc:creator>arulsettu</dc:creator>
      <dc:date>2015-12-11T08:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Return substring from Field</title>
      <link>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997924#M949522</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;It's a start but not 100% what I need. Currently I have this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Reference,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;mid(Reference,Index(Reference,'A_')+1,7) as JC_Acct,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Amount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it works in some cases, but it returns ANY value where it finds an "A" but I need to specifically look for an A or a U followed by 6 NUMBERS. For instance, if the field contains A124282-0837698755 it will return the correct value, but if the field contains ABSA Bank A257286 it will return "ABSA Ba" when I want it to return "&lt;SPAN style="font-size: 13.3333px;"&gt;A257286" - see image attached. If It can't find anything it should return null.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Account Number Wildmatch.jpg" class="jive-image image-1" src="/legacyfs/online/108727_Account Number Wildmatch.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 08:15:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997924#M949522</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2015-12-11T08:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: Return substring from Field</title>
      <link>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997925#M949523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This will keep all numbers - please see my example above.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 08:16:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997925#M949523</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2015-12-11T08:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Return substring from Field</title>
      <link>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997926#M949524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The most generic way to do this is something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;//---- Split the field into tokens (assumes that data is in table called Data)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;T_Accounts1:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD Original,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; SubField(Original, ' ') As Tokens&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident Data;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;//---- filter the tokens for account numbers&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;T_Accounts2:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD Original,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Token as Account&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident T_Accounts1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Where WildMatch(Token, 'A*', 'U*')&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; And Len(Token) = 7&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; And IsNum(Mid(Token, 2, 7));&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;//---- Add back to main data table. The Group By will prevent multiples from adding rows to Data&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp; if there is more than one account number in the tokens&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Left Join (Data)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD Original,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; MinString(Account) As Account&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident T_Accounts2&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Group by Original;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;//---- Clean up&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DROP Table T_Accounts1, T_Accounts2;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 08:25:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997926#M949524</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-12-11T08:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: Return substring from Field</title>
      <link>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997927#M949525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll try this now but my first concern is that the substring I need is not necessarily split from the rest of the field by a space. A field may for instance be "&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;A124282-0837698755"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is basically free text for a customer making a bank payment and they do weird stuff which they think helps...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I use this but split into tokens using more than one delimiter?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 08:30:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997927#M949525</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2015-12-11T08:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Return substring from Field</title>
      <link>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997928#M949526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe a regular expression would be best here. You can add support for regular expressions using a small macro that you can call from your script, see for example&lt;/P&gt;&lt;P&gt;&lt;A href="http://qlikviewcookbook.com/download/regular-expression-pattern-matching/" title="http://qlikviewcookbook.com/download/regular-expression-pattern-matching/"&gt;http://qlikviewcookbook.com/download/regular-expression-pattern-matching/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-4587"&gt;How to use regular expressions&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.regular-expressions.info/" title="http://www.regular-expressions.info/"&gt;Regular-Expressions.info - Regex Tutorial, Examples and Reference - Regexp Patterns&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 08:52:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997928#M949526</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-12-11T08:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: Return substring from Field</title>
      <link>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997929#M949527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not my most elegant code and you probably do it in fewer steps, but its possible to do what you want without too much pain. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 11:38:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997929#M949527</guid>
      <dc:creator>roger_stone</dc:creator>
      <dc:date>2015-12-11T11:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: Return substring from Field</title>
      <link>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997930#M949528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did not even know that this kind of thing existed (even out of QlikView). Thanks for sharing this Stefan. I am sure I will need to use this sometime in the future.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 12:08:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997930#M949528</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-12-11T12:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Return substring from Field</title>
      <link>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997931#M949529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry but I have no idea how to use this? What does "otherfield" refer to?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My initial ("Tom") data table import looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Tom:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;LOAD Date, &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description1, &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Reference, &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // mid(Reference,Index(Reference,'A_')+1,7) as JC_Acct,&amp;nbsp;&amp;nbsp;&amp;nbsp; (not used in your proposal)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Amount &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;FROM XYZ;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 12:16:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997931#M949529</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2015-12-11T12:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Return substring from Field</title>
      <link>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997932#M949530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's just a random field I inserted so that you can see that all rows come through, even if I have set the account number to null.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 12:27:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997932#M949530</guid>
      <dc:creator>roger_stone</dc:creator>
      <dc:date>2015-12-11T12:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: Return substring from Field</title>
      <link>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997933#M949531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I end up with one reference field then returning multiple Strip values in certain cases:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Image1.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/108750_Image1.jpg" style="height: 349px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 12:37:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997933#M949531</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2015-12-11T12:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: Return substring from Field</title>
      <link>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997934#M949532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I provided the code like that so you could see each stage of the process. You're getting joins between the staging tables and your original data, so you would need to do something like this - note the DROP TABLE statements:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Indata, OtherField&lt;/P&gt;&lt;P&gt;A130116, B&lt;/P&gt;&lt;P&gt;6610295603088, C&lt;/P&gt;&lt;P&gt;A123542, D&lt;/P&gt;&lt;P&gt;U122545, E&lt;/P&gt;&lt;P&gt;239343, F&lt;/P&gt;&lt;P&gt;ABSA Bank A257286, G&lt;/P&gt;&lt;P&gt;A124282-0837698755, H&lt;/P&gt;&lt;P&gt;ABSA Bank A214405, I&lt;/P&gt;&lt;P&gt;A135358, J&lt;/P&gt;&lt;P&gt;Text A123456 More text, K&lt;/P&gt;&lt;P&gt;Some text U123456 A lot more text, L&lt;/P&gt;&lt;P&gt;665544U654321Text, M&lt;/P&gt;&lt;P&gt;]; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dick:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;KEEPCHAR(Indata,'AU1234567890') AS Strip1,&lt;/P&gt;&lt;P&gt;OtherField&lt;/P&gt;&lt;P&gt;RESIDENT Tom;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE Tom;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Harry:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;IF (NOT ISNUM(Strip1), Strip1, NULL()) AS Strip2,&lt;/P&gt;&lt;P&gt;OtherField&lt;/P&gt;&lt;P&gt;RESIDENT Dick;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE Dick;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;IF (LEN(Strip2)=7, Strip2,&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF ((LEFT(Strip2,1) = 'A' OR LEFT(Strip2,1) = 'U') AND ISNUM(MID(Strip2,2,6)),LEFT(Strip2,7),&lt;/P&gt;&lt;P&gt;&amp;nbsp; RIGHT(Strip2,7))) AS Strip3,&lt;/P&gt;&lt;P&gt;OtherField&lt;/P&gt;&lt;P&gt;RESIDENT Harry;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE Harry;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 13:10:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997934#M949532</guid>
      <dc:creator>roger_stone</dc:creator>
      <dc:date>2015-12-11T13:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Return substring from Field</title>
      <link>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997935#M949533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using regular expression Macro:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;'&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;' Regular Expression function. Returns true if astring matches pattern, false otherwise.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;' Uses the VBScript RegExp Object.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;'&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Function regexTest(astring, pattern)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Set regEx = New RegExp&amp;nbsp; ' Create a regular expression object&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; regEx.Pattern = pattern&amp;nbsp; ' Set the pattern&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; regexTest = regEx.Execute(astring).Item(0)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;End Function&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script boils down to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Accounts:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD *,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; regexTest(Indata,'([AU])([0-9]){6}') as Result &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;INLINE [&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Indata, OtherField&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;A130116, B&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;6610295603088, C&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;A123542, D&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;U122545, E&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;239343, F&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ABSA Bank A257286, G&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;A124282-0837698755, H&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ABSA Bank A214405, I&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;A135358, J&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Text A123456 More text, K&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Some text U123456 A lot more text, L&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;665544U654321Text, M&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;A124282-0837698755, N&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Dec 2015 15:06:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-substring-from-Field/m-p/997935#M949533</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-12-14T15:06:09Z</dc:date>
    </item>
  </channel>
</rss>

