<?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 Extracting Text Between Parenthesis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Extracting-Text-Between-Parenthesis/m-p/320253#M498948</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;G'day;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This question is quite similar to: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://community.qlik.com/message/135716#135716"&gt;http://community.qlik.com/message/135716#135716&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact it is for the same application with a data set that is just... messy... Not much I can do about that though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a particular field that holds the Customer ID along with some other junk information. There is one initial issue that I think will be easy enough to code, however there is a few 'spanners' to throw into the wreck...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example Set:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(22883) PRODUCT DATA -1&lt;/P&gt;&lt;P&gt;(33782) MORE RANDOM STUFF 22-3&lt;/P&gt;&lt;P&gt;(637286) Example Line 77&lt;/P&gt;&lt;P&gt;21-1 OMPE 111&lt;/P&gt;&lt;P&gt;772891 KKiIM 88-2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, first and foremost I need to extract the numbers between the parenthesis in the first thre lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to exclude the line that had a number where LEN() &amp;lt; 4... (ie: Line 4)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also need to include the number from line 5 that doesn't have a parenthesis around it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then need to save it all into a new field called CustomerID or similar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the example set should turn into:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;22883&lt;/P&gt;&lt;P&gt;33782&lt;/P&gt;&lt;P&gt;637286&lt;/P&gt;&lt;P&gt;772891&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How would I best do this? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Aug 2011 01:34:51 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-08-01T01:34:51Z</dc:date>
    <item>
      <title>Extracting Text Between Parenthesis</title>
      <link>https://community.qlik.com/t5/QlikView/Extracting-Text-Between-Parenthesis/m-p/320253#M498948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;G'day;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This question is quite similar to: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://community.qlik.com/message/135716#135716"&gt;http://community.qlik.com/message/135716#135716&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact it is for the same application with a data set that is just... messy... Not much I can do about that though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a particular field that holds the Customer ID along with some other junk information. There is one initial issue that I think will be easy enough to code, however there is a few 'spanners' to throw into the wreck...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example Set:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(22883) PRODUCT DATA -1&lt;/P&gt;&lt;P&gt;(33782) MORE RANDOM STUFF 22-3&lt;/P&gt;&lt;P&gt;(637286) Example Line 77&lt;/P&gt;&lt;P&gt;21-1 OMPE 111&lt;/P&gt;&lt;P&gt;772891 KKiIM 88-2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, first and foremost I need to extract the numbers between the parenthesis in the first thre lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to exclude the line that had a number where LEN() &amp;lt; 4... (ie: Line 4)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also need to include the number from line 5 that doesn't have a parenthesis around it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then need to save it all into a new field called CustomerID or similar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the example set should turn into:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;22883&lt;/P&gt;&lt;P&gt;33782&lt;/P&gt;&lt;P&gt;637286&lt;/P&gt;&lt;P&gt;772891&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How would I best do this? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2011 01:34:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extracting-Text-Between-Parenthesis/m-p/320253#M498948</guid>
      <dc:creator />
      <dc:date>2011-08-01T01:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Text Between Parenthesis</title>
      <link>https://community.qlik.com/t5/QlikView/Extracting-Text-Between-Parenthesis/m-p/320254#M498949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following script does what you want and saves the CustomerID values. There may be other ways of doing this also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Data:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD *, PurgeChar(SubField(String,' ',1),'()') as Part1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD * Inline [&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;String&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;(22883) PRODUCT DATA -1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;(33782) MORE RANDOM STUFF 22-3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;(637286) Example Line 77&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;21-1 OMPE 111&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;772891 KKiIM 88-2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Customer:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD Part1 as CustomerID Resident Data &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;where Len(Part1) &amp;gt; 4 and Len(PurgeChar(Part1,'0123456789'))=0;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2011 02:50:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extracting-Text-Between-Parenthesis/m-p/320254#M498949</guid>
      <dc:creator>nagaiank</dc:creator>
      <dc:date>2011-08-01T02:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Text Between Parenthesis</title>
      <link>https://community.qlik.com/t5/QlikView/Extracting-Text-Between-Parenthesis/m-p/320255#M498950</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;&lt;/P&gt;&lt;P&gt;See if the attached sample can help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2011 02:50:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extracting-Text-Between-Parenthesis/m-p/320255#M498950</guid>
      <dc:creator />
      <dc:date>2011-08-01T02:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Text Between Parenthesis</title>
      <link>https://community.qlik.com/t5/QlikView/Extracting-Text-Between-Parenthesis/m-p/320256#M498951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rock on! Thanks guys. BlackRockS that was really good, works a treat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2011 02:59:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extracting-Text-Between-Parenthesis/m-p/320256#M498951</guid>
      <dc:creator />
      <dc:date>2011-08-01T02:59:52Z</dc:date>
    </item>
  </channel>
</rss>

