<?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 manipulating strings in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/manipulating-strings/m-p/211075#M65453</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi is the string always (AB8345VC2013) 12 characters long?&lt;/P&gt;&lt;P&gt;becuase then i can write you a piece of code to sort this out....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Jul 2010 15:08:03 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-07-01T15:08:03Z</dc:date>
    <item>
      <title>manipulating strings</title>
      <link>https://community.qlik.com/t5/QlikView/manipulating-strings/m-p/211071#M65449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm looking for a clever way to do the following :&lt;/P&gt;&lt;P&gt;I have strings like this&lt;/P&gt;&lt;P&gt;AB8345VC0123&lt;/P&gt;&lt;P&gt;and I need to have them converted into&lt;/P&gt;&lt;P&gt;AB-8345-VC-0123&lt;/P&gt;&lt;P&gt;So, it's about putting "-" between letters and number blocks ... there is no pattern in the original string to rely on ... any idea how to do this ?&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 12:15:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/manipulating-strings/m-p/211071#M65449</guid>
      <dc:creator>thomaswrieck</dc:creator>
      <dc:date>2010-07-01T12:15:43Z</dc:date>
    </item>
    <item>
      <title>manipulating strings</title>
      <link>https://community.qlik.com/t5/QlikView/manipulating-strings/m-p/211072#M65450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas&lt;/P&gt;&lt;P&gt;If the field always look like that with 2 letter 4 number 2 letter 4 number, you can use this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=left(Field,2) &amp;amp; '-' &amp;amp; right(left(Field,6),4) &amp;amp; '-' &amp;amp; right(left(Field,8),2) &amp;amp; '-' &amp;amp; right(Field,4)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anders&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 12:35:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/manipulating-strings/m-p/211072#M65450</guid>
      <dc:creator />
      <dc:date>2010-07-01T12:35:49Z</dc:date>
    </item>
    <item>
      <title>manipulating strings</title>
      <link>https://community.qlik.com/t5/QlikView/manipulating-strings/m-p/211073#M65451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;I don't know how much this will works. This is just an idea to try by yourself.&lt;/P&gt;&lt;P&gt;I have a Logic. First get the length of the String and loop it in Array. If the digit is alphabet then have the statement like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=KeepChar(String,'ABCDEFGHIJKLMENOPQRSTUVWXYZ')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Else if the digit is Number have the statment like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;='-'&amp;amp;KeepChar(String,'1234567890')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope you can try this with the Help of API Guide.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 13:05:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/manipulating-strings/m-p/211073#M65451</guid>
      <dc:creator />
      <dc:date>2010-07-01T13:05:26Z</dc:date>
    </item>
    <item>
      <title>manipulating strings</title>
      <link>https://community.qlik.com/t5/QlikView/manipulating-strings/m-p/211074#M65452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yep .. similar to what I was ending up with .... len(string, then if(char is A-Z and next char isr 0-9) -&amp;gt; replace(firstchar, firstchar-) ... tanks a lot&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 13:17:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/manipulating-strings/m-p/211074#M65452</guid>
      <dc:creator>thomaswrieck</dc:creator>
      <dc:date>2010-07-01T13:17:35Z</dc:date>
    </item>
    <item>
      <title>manipulating strings</title>
      <link>https://community.qlik.com/t5/QlikView/manipulating-strings/m-p/211075#M65453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi is the string always (AB8345VC2013) 12 characters long?&lt;/P&gt;&lt;P&gt;becuase then i can write you a piece of code to sort this out....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 15:08:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/manipulating-strings/m-p/211075#M65453</guid>
      <dc:creator />
      <dc:date>2010-07-01T15:08:03Z</dc:date>
    </item>
    <item>
      <title>manipulating strings</title>
      <link>https://community.qlik.com/t5/QlikView/manipulating-strings/m-p/211076#M65454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm not sure yet what the pattern for these strings are ... I guess there is none so I'm preparing for something very generic ... no matter how long, no matter how the pattern is ... the only thing that is very sure is the usage of (A-Z) and (0-9) combinations ... no other chars&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 15:14:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/manipulating-strings/m-p/211076#M65454</guid>
      <dc:creator>thomaswrieck</dc:creator>
      <dc:date>2010-07-01T15:14:13Z</dc:date>
    </item>
    <item>
      <title>manipulating strings</title>
      <link>https://community.qlik.com/t5/QlikView/manipulating-strings/m-p/211077#M65455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a weird solution. Generate a mapping table mapping things like 7B to 7-B, and X5 to X-5, with every possible combination. Then mapsubstring() your data using that table. It appears that you have to do it twice to get everything, but it seems to work. See attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 21:53:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/manipulating-strings/m-p/211077#M65455</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-07-01T21:53:41Z</dc:date>
    </item>
    <item>
      <title>manipulating strings</title>
      <link>https://community.qlik.com/t5/QlikView/manipulating-strings/m-p/211078#M65456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; wow excellent ... I was hesitating doing something like this cause you need to prepare this mapping table ...&lt;/P&gt;&lt;P&gt;meanwhile I ended up doing it with the following code , still evaluating if it works for every thinkable combination ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vString='Afdfdgsd-fX456G-H78GH';&lt;/P&gt;&lt;P&gt;SET vNew='Afdfdgsd-fX456G-H78GH';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* ----------------- Removing Non-Letters and Non-Numbers --------------------------- */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (findoneof('$(vString)','-')&amp;gt;0) then /* Insert more chars here in &amp;lt;findeoneof&amp;gt; to be removed */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vString=purgechar('$(vString)','-');&lt;/P&gt;&lt;P&gt;LET vNew='$(vString)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* ---------------------------------------------------------------------------------- */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET v_L=2*(len('$(vString)')); /* String is growing for each inserted '-',&lt;/P&gt;&lt;P&gt;worst case is a string with alternating&lt;/P&gt;&lt;P&gt;letters and numbers */&lt;/P&gt;&lt;P&gt;LET v_Skip=0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* ------------------- Start evaluating/modifieing string --------------------------- */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i=1 to $(v_L)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vString='$(vNew)';&lt;/P&gt;&lt;P&gt;LET vs1=IsText(mid('$(vString)',$(i)+$(v_Skip),1));&lt;/P&gt;&lt;P&gt;LET vs2=IsText(mid('$(vString)',$(i)+$(v_Skip)+1,1));&lt;/P&gt;&lt;P&gt;LET v3=left('$(vString)',$(i)+$(v_Skip));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* If char1 is A-Z and char2 is 0-9 (or the other way around).&lt;/P&gt;&lt;P&gt;This is the point to do something */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(($(vs1)&amp;lt;0 and $(vs2)&amp;gt;-1) or ($(vs1)&amp;gt;-1 and $(vs2)&amp;lt;0) ) then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Replaces the &amp;lt;char&amp;gt; with &amp;lt;char-&amp;gt; and concat the rest of the so far unmodified piece of the string */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vNew=replace('$(v3)','$(v3)','$(v3)'&amp;amp;'-')&amp;amp;mid('$(vString)',$(i)+1,$(v_L)+1) ; // is AD-56GH78GHB&lt;/P&gt;&lt;P&gt;LET v_Skip=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET v_Skip=0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jul 2010 08:40:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/manipulating-strings/m-p/211078#M65456</guid>
      <dc:creator>thomaswrieck</dc:creator>
      <dc:date>2010-07-02T08:40:18Z</dc:date>
    </item>
    <item>
      <title>manipulating strings</title>
      <link>https://community.qlik.com/t5/QlikView/manipulating-strings/m-p/211079#M65457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;just wanted to show what my final solution for this is ... maybe it is useful for somebody as well ...&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Jul 2010 13:22:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/manipulating-strings/m-p/211079#M65457</guid>
      <dc:creator>thomaswrieck</dc:creator>
      <dc:date>2010-07-04T13:22:29Z</dc:date>
    </item>
  </channel>
</rss>

