<?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: Number of times in a row a character appears in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Number-of-times-in-a-row-a-character-appears/m-p/657664#M240072</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here might be some code to help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load *, if(index(Code, ' '), subfield(Code, ' '), if(index(Code, '-'), subfield(Code, '-'), Code)) as Test, rowno() as Row Inline [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;XXXXXXXXXX&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;999-99-9999&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;XXX XXXXXXX&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;XXXXX-9&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load Code as Key,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(index(Code, ' '), concat(left(Test, 1) &amp;amp; '(' &amp;amp; len(Test) &amp;amp; ')', ' ', Row), concat(left(Test, 1) &amp;amp; '(' &amp;amp; len(Test) &amp;amp; ')', '-', Row)) as Test2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Table1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Group by Code;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Drop Table Table1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course, this formula is based on your example, if your data is a bit different, you might have to make changes to it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Oct 2014 19:06:56 GMT</pubDate>
    <dc:creator>jerem1234</dc:creator>
    <dc:date>2014-10-03T19:06:56Z</dc:date>
    <item>
      <title>Number of times in a row a character appears</title>
      <link>https://community.qlik.com/t5/QlikView/Number-of-times-in-a-row-a-character-appears/m-p/657661#M240069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a combination of QlikView String functions that would allow me to turn something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;xxxxx-999-xxxxx&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;into:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x(5)-9(3)-x(5)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There would be mixtures of x's and 9's in the columns I'd be running this against.&amp;nbsp; Thank you for any help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Oct 2014 17:28:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Number-of-times-in-a-row-a-character-appears/m-p/657661#M240069</guid>
      <dc:creator>joshabbott</dc:creator>
      <dc:date>2014-10-03T17:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: Number of times in a row a character appears</title>
      <link>https://community.qlik.com/t5/QlikView/Number-of-times-in-a-row-a-character-appears/m-p/657662#M240070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you give some more examples of input and expected output?&lt;/P&gt;&lt;P&gt;Is it really only 'x' and '9' as characters you are looking for or is it just a placeholder?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Oct 2014 17:35:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Number-of-times-in-a-row-a-character-appears/m-p/657662#M240070</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-10-03T17:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: Number of times in a row a character appears</title>
      <link>https://community.qlik.com/t5/QlikView/Number-of-times-in-a-row-a-character-appears/m-p/657663#M240071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, this would be a pattern from a table.&amp;nbsp; The pattern that I would want to count would only be 'X' and '9', but I'd want to display spaces or dashes if they were in the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actual Value | Value I'd like to get&lt;BR /&gt;XXXXXXXXXX | x(10)&lt;/P&gt;&lt;P&gt;999-99-9999 | 9(3)-9(2)-9(4)&lt;/P&gt;&lt;P&gt;XXX XXXXXXX | X(3) X(7)&lt;/P&gt;&lt;P&gt;XXXXX-9 | X(5)-9&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Oct 2014 17:41:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Number-of-times-in-a-row-a-character-appears/m-p/657663#M240071</guid>
      <dc:creator>joshabbott</dc:creator>
      <dc:date>2014-10-03T17:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: Number of times in a row a character appears</title>
      <link>https://community.qlik.com/t5/QlikView/Number-of-times-in-a-row-a-character-appears/m-p/657664#M240072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here might be some code to help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load *, if(index(Code, ' '), subfield(Code, ' '), if(index(Code, '-'), subfield(Code, '-'), Code)) as Test, rowno() as Row Inline [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;XXXXXXXXXX&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;999-99-9999&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;XXX XXXXXXX&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;XXXXX-9&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load Code as Key,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(index(Code, ' '), concat(left(Test, 1) &amp;amp; '(' &amp;amp; len(Test) &amp;amp; ')', ' ', Row), concat(left(Test, 1) &amp;amp; '(' &amp;amp; len(Test) &amp;amp; ')', '-', Row)) as Test2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Table1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Group by Code;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Drop Table Table1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course, this formula is based on your example, if your data is a bit different, you might have to make changes to it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Oct 2014 19:06:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Number-of-times-in-a-row-a-character-appears/m-p/657664#M240072</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2014-10-03T19:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Number of times in a row a character appears</title>
      <link>https://community.qlik.com/t5/QlikView/Number-of-times-in-a-row-a-character-appears/m-p/657665#M240073</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;I tried to generate a generic approach, here's my result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_136374_Pic1.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/68262_QlikCommunity_Thread_136374_Pic1.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14123749593911513" jivemacro_uid="_14123749593911513"&gt;
&lt;P&gt;tabInput:&lt;/P&gt;
&lt;P&gt;LOAD *,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Alt(Peek(group)-(Previous(Char)&amp;lt;&amp;gt;Char or Previous(RecNo)&amp;lt;&amp;gt;RecNo),1) as group; &lt;/P&gt;
&lt;P&gt;LOAD *,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RecNo() as RecNo,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Mid(text,IterNo(),1) as Char&lt;/P&gt;
&lt;P&gt;INLINE [&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xxxxx-999-xxxxx&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XXXXXXXXXX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 999-99-9999&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XXX XXXXXXX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XXXXX-9&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xxXX-9999&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XXXXYY-999-XX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AAAABBB CCDDD-EEFFG HHHHIIII&lt;/P&gt;
&lt;P&gt;]&lt;/P&gt;
&lt;P&gt;While IterNo()&amp;lt;=Len(text);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;tabOutput:&lt;/P&gt;
&lt;P&gt;LOAD text,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Concat(subpatt,'',group) as pattern&lt;/P&gt;
&lt;P&gt;Group By text, RecNo;&lt;/P&gt;
&lt;P&gt;LOAD text, RecNo, group,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pick(FindOneOf(FirstValue(Char),' -')+1,FirstValue(Char)&amp;amp;'('&amp;amp;Count(Char)&amp;amp;')',FirstValue(Char)) as subpatt&lt;/P&gt;
&lt;P&gt;Resident tabInput&lt;/P&gt;
&lt;P&gt;Group By text, RecNo, group;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP Table tabInput;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope&amp;nbsp; this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Oct 2014 22:25:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Number-of-times-in-a-row-a-character-appears/m-p/657665#M240073</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-10-03T22:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Number of times in a row a character appears</title>
      <link>https://community.qlik.com/t5/QlikView/Number-of-times-in-a-row-a-character-appears/m-p/657666#M240074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you both for your help! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2014 13:05:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Number-of-times-in-a-row-a-character-appears/m-p/657666#M240074</guid>
      <dc:creator>joshabbott</dc:creator>
      <dc:date>2014-10-07T13:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: Number of times in a row a character appears</title>
      <link>https://community.qlik.com/t5/QlikView/Number-of-times-in-a-row-a-character-appears/m-p/657667#M240075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Superb &lt;A href="https://community.qlik.com/qlik-users/61824"&gt;Marco Wedel&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2014 12:18:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Number-of-times-in-a-row-a-character-appears/m-p/657667#M240075</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2014-10-10T12:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: Number of times in a row a character appears</title>
      <link>https://community.qlik.com/t5/QlikView/Number-of-times-in-a-row-a-character-appears/m-p/657668#M240076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2014 12:25:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Number-of-times-in-a-row-a-character-appears/m-p/657668#M240076</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-10-10T12:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: Number of times in a row a character appears</title>
      <link>https://community.qlik.com/t5/QlikView/Number-of-times-in-a-row-a-character-appears/m-p/657669#M240077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Very interesting code, Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Mar 2016 19:31:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Number-of-times-in-a-row-a-character-appears/m-p/657669#M240077</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2016-03-22T19:31:23Z</dc:date>
    </item>
  </channel>
</rss>

