<?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 String Pattern Matching in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/String-Pattern-Matching/m-p/495230#M686608</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello my QV friends.&amp;nbsp; I am trying to figure out the best way to find string patterns.&amp;nbsp; For example, t&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;he string in question, if it has values for all sections, can look like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1234*12345678*1234567891*12345678*1234&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So that would be 4 characters, asterisk, then 8, asterisk, 10, asterisk, 8, asterisk and then 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, some times there may not be a value in the first section of 8, like this:&lt;/P&gt;&lt;P&gt;1234**1234567891*12345678*1234&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or maybe sometimes it can be like this:&lt;/P&gt;&lt;P&gt;1234*12345678**12345678*1234&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should I be using WILDMATCH for this?&amp;nbsp; I am trying to capture all possible variations.&amp;nbsp; Any other ideas?&amp;nbsp; Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*****UPDATE******&lt;/P&gt;&lt;P&gt;I have been working on this now for a little while and have the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="html" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_1389367805724726" jivemacro_uid="_1389367805724726"&gt;
&lt;P&gt;TEST:&lt;/P&gt;
&lt;P&gt;LOAD SAP_GL_CODE,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; IF(LEN(SAP_GL_CODE) = 38 AND ,'YES','NO') AS TEST,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; IF(SAP_GL_CODE LIKE '????' &amp;amp; chr(42) &amp;amp; '????????' &amp;amp;chr(42)&amp;amp; '??????????' &amp;amp;chr(42)&amp;amp; '????????' &amp;amp;chr(42)&amp;amp; '????','YES','NO') AS ALL&lt;/P&gt;
&lt;P&gt;RESIDENT DATA;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem now is that if I put something like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="html" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13893679101095823" jivemacro_uid="_13893679101095823"&gt;
&lt;P&gt;IF(SAP_GL_CODE LIKE '????' &amp;amp; chr(42) &amp;amp; chr(42) &amp;amp; '??????????' &amp;amp;chr(42)&amp;amp; '????????' &amp;amp;chr(42)&amp;amp; '????','YES','NO') AS NOT_ALL&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this code doesn't work.&amp;nbsp; Does anyone know how to write two chr()'s back to back??&amp;nbsp; Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Jan 2014 12:52:55 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-01-10T12:52:55Z</dc:date>
    <item>
      <title>String Pattern Matching</title>
      <link>https://community.qlik.com/t5/QlikView/String-Pattern-Matching/m-p/495230#M686608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello my QV friends.&amp;nbsp; I am trying to figure out the best way to find string patterns.&amp;nbsp; For example, t&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;he string in question, if it has values for all sections, can look like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1234*12345678*1234567891*12345678*1234&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So that would be 4 characters, asterisk, then 8, asterisk, 10, asterisk, 8, asterisk and then 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, some times there may not be a value in the first section of 8, like this:&lt;/P&gt;&lt;P&gt;1234**1234567891*12345678*1234&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or maybe sometimes it can be like this:&lt;/P&gt;&lt;P&gt;1234*12345678**12345678*1234&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should I be using WILDMATCH for this?&amp;nbsp; I am trying to capture all possible variations.&amp;nbsp; Any other ideas?&amp;nbsp; Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*****UPDATE******&lt;/P&gt;&lt;P&gt;I have been working on this now for a little while and have the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="html" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_1389367805724726" jivemacro_uid="_1389367805724726"&gt;
&lt;P&gt;TEST:&lt;/P&gt;
&lt;P&gt;LOAD SAP_GL_CODE,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; IF(LEN(SAP_GL_CODE) = 38 AND ,'YES','NO') AS TEST,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; IF(SAP_GL_CODE LIKE '????' &amp;amp; chr(42) &amp;amp; '????????' &amp;amp;chr(42)&amp;amp; '??????????' &amp;amp;chr(42)&amp;amp; '????????' &amp;amp;chr(42)&amp;amp; '????','YES','NO') AS ALL&lt;/P&gt;
&lt;P&gt;RESIDENT DATA;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem now is that if I put something like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="html" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13893679101095823" jivemacro_uid="_13893679101095823"&gt;
&lt;P&gt;IF(SAP_GL_CODE LIKE '????' &amp;amp; chr(42) &amp;amp; chr(42) &amp;amp; '??????????' &amp;amp;chr(42)&amp;amp; '????????' &amp;amp;chr(42)&amp;amp; '????','YES','NO') AS NOT_ALL&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this code doesn't work.&amp;nbsp; Does anyone know how to write two chr()'s back to back??&amp;nbsp; Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 12:52:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/String-Pattern-Matching/m-p/495230#M686608</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-01-10T12:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: String Pattern Matching</title>
      <link>https://community.qlik.com/t5/QlikView/String-Pattern-Matching/m-p/495231#M686609</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;Perhaps you had better to try regular expressions to capture all possible variations.&lt;/P&gt;&lt;P&gt;There are some examples how to use them in a macro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 19:44:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/String-Pattern-Matching/m-p/495231#M686609</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2014-01-10T19:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: String Pattern Matching</title>
      <link>https://community.qlik.com/t5/QlikView/String-Pattern-Matching/m-p/495232#M686610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for replying whiteline.&amp;nbsp; Actually figured it out with help from a colleague.&amp;nbsp; Here's what my code ended up looking like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF(LEN(SAP_GL_CODE) = 30, MID(SAP_GL_CODE,6,8),&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(LEN(SUBFIELD(SAP_GL_CODE,'*',2))&amp;lt;2 OR SUBFIELD(SAP_GL_CODE,'*',2)='' OR ISNULL(Subfield(SAP_GL_CODE,'*',2)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; MID(SAP_GL_CODE,7,10),'')) AS PROFIT_CENTER,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 19:50:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/String-Pattern-Matching/m-p/495232#M686610</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-01-10T19:50:12Z</dc:date>
    </item>
  </channel>
</rss>

