<?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: separating values by comma in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/separating-values-by-comma/m-p/439856#M163957</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Think this works better ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Strings:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load Replace(Rawtext, 'zzz','') as Rawtext, pass, Replace(String, 'zzz,','') as String;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load Rawtext,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; iterno() as pass, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(iterno()=1,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Replace(Rawtext,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chr(iterno()+64), ',' &amp;amp; chr(iterno()+64)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Replace(peek('String'), chr(iterno()+64), ',' &amp;amp; chr(iterno()+64))) as String while iterNo() &amp;gt;=1 and iterNo() &amp;lt;= 26;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;load 'zzz' &amp;amp; Rawtext as Rawtext inline [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Rawtext&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CatDogRat&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;HorsePig&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;HorseHare&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ZebraAntelope];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;inner join&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load 26 as pass autogenerate 1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Drop field pass;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 May 2013 10:53:57 GMT</pubDate>
    <dc:creator>flipside</dc:creator>
    <dc:date>2013-05-09T10:53:57Z</dc:date>
    <item>
      <title>separating values by comma</title>
      <link>https://community.qlik.com/t5/QlikView/separating-values-by-comma/m-p/439854#M163955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is my sample data , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say i have values like&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CatDogRat&lt;/P&gt;&lt;P&gt;HorsePig&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do i modify as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cat,Dog,Rat&lt;/P&gt;&lt;P&gt;Horse,Pig&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Radhika&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 May 2013 15:22:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/separating-values-by-comma/m-p/439854#M163955</guid>
      <dc:creator />
      <dc:date>2013-05-08T15:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: separating values by comma</title>
      <link>https://community.qlik.com/t5/QlikView/separating-values-by-comma/m-p/439855#M163956</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;Assuming the words are identifiable by a starting Uppercase letter, then you can fix it as the following example ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Strings:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;load Rawtext, concat(String,',') as Fixedtext group by Rawtext;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;load Rawtext, Split, mid(Split,iterno(),1) &amp;amp; TextBetween(Rawtext,mid(Split,iterno(),1),mid(Split,iterno()+1,1)) as String while iterNo() &amp;lt;= len(Split);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;load Rawtext, PurgeChar(Rawtext,'abcdefghijklmnopqrstuvwxyz') as Split &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;inline [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Rawtext&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CatDogRat&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;HorsePig];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: Hmmm, doesn't work if you have words beginning with same letter though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2013 10:07:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/separating-values-by-comma/m-p/439855#M163956</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2013-05-09T10:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: separating values by comma</title>
      <link>https://community.qlik.com/t5/QlikView/separating-values-by-comma/m-p/439856#M163957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Think this works better ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Strings:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load Replace(Rawtext, 'zzz','') as Rawtext, pass, Replace(String, 'zzz,','') as String;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load Rawtext,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; iterno() as pass, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(iterno()=1,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Replace(Rawtext,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chr(iterno()+64), ',' &amp;amp; chr(iterno()+64)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Replace(peek('String'), chr(iterno()+64), ',' &amp;amp; chr(iterno()+64))) as String while iterNo() &amp;gt;=1 and iterNo() &amp;lt;= 26;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;load 'zzz' &amp;amp; Rawtext as Rawtext inline [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Rawtext&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CatDogRat&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;HorsePig&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;HorseHare&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ZebraAntelope];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;inner join&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load 26 as pass autogenerate 1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Drop field pass;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2013 10:53:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/separating-values-by-comma/m-p/439856#M163957</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2013-05-09T10:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: separating values by comma</title>
      <link>https://community.qlik.com/t5/QlikView/separating-values-by-comma/m-p/439857#M163958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Flip please explain the code ..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2013 11:05:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/separating-values-by-comma/m-p/439857#M163958</guid>
      <dc:creator>sujeetsingh</dc:creator>
      <dc:date>2013-05-09T11:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: separating values by comma</title>
      <link>https://community.qlik.com/t5/QlikView/separating-values-by-comma/m-p/439858#M163959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Of course.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, some test data (the 'zzz' bit will become clear later)...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;load 'zzz' &amp;amp; Rawtext as Rawtext inline [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Rawtext&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CatDogRat&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;HorsePig&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;HorseHare&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ZebraAntelope];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... then we need to look at each string and place a comma before the capital letters. I decided the easiest way was to loop over each capital letter, replacing them as needed with [comma+capital letter], so as a preceding load to the test data ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load Rawtext,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; iterno() as pass, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(iterno()=1,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Replace(Rawtext,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chr(iterno()+64), ',' &amp;amp; chr(iterno()+64)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Replace(peek('String'), chr(iterno()+64), ',' &amp;amp; chr(iterno()+64))) as String while iterNo() &amp;gt;=1 and iterNo() &amp;lt;= 26;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... this will expand the data, creating a row for each iterno() 1 to 26 (one for each letter of the alphabet). If it's the first iteration, then use the string, otherwise 'peek' the last value of the string. We need to pass the ASCII code for each letter which starts at 65 for uppercase A (or iterno() + 64) to 90 for uppercase Z.&amp;nbsp; After this we only need the last pass, so we can inner join on a set value of pass (26) to get rid of pass values 1 to 25 ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;inner join&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load 26 as pass autogenerate 1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... then we just need to eliminate the rogue comma introduced at the front of the string.&amp;nbsp; I placed an identifier 'zzz' to make it simple using another Replace in a preceding load (you will see the text to remove in the string is 'zzz,' and not just 'zzz') ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load Replace(Rawtext, 'zzz','') as Rawtext, pass, Replace(String, 'zzz,','') as String;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... finally, remove the 'pass' field as not needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Drop field pass;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2013 11:50:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/separating-values-by-comma/m-p/439858#M163959</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2013-05-09T11:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: separating values by comma</title>
      <link>https://community.qlik.com/t5/QlikView/separating-values-by-comma/m-p/439859#M163960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice ! &lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2013 11:53:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/separating-values-by-comma/m-p/439859#M163960</guid>
      <dc:creator>sujeetsingh</dc:creator>
      <dc:date>2013-05-09T11:53:07Z</dc:date>
    </item>
  </channel>
</rss>

