<?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: Split string in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Split-string/m-p/257519#M97325</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Thomas. I have a solution that might work. See attached. Regards Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Nov 2011 09:40:07 GMT</pubDate>
    <dc:creator>RSvebeck</dc:creator>
    <dc:date>2011-11-28T09:40:07Z</dc:date>
    <item>
      <title>Split string</title>
      <link>https://community.qlik.com/t5/QlikView/Split-string/m-p/257515#M97321</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 want to split a string on ',' but only if it's not inside paranteses.&lt;/P&gt;&lt;P&gt;Ex. aa bb (c,c) dd,dd ss aa,ee rr ff dd should be three:&lt;/P&gt;&lt;P&gt;aa bb (c,c) dd&lt;/P&gt;&lt;P&gt;dd ss aa&lt;/P&gt;&lt;P&gt;ee rr ff dd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Nov 2011 22:24:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Split-string/m-p/257515#M97321</guid>
      <dc:creator />
      <dc:date>2011-11-25T22:24:37Z</dc:date>
    </item>
    <item>
      <title>Split string</title>
      <link>https://community.qlik.com/t5/QlikView/Split-string/m-p/257516#M97322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;H4&gt;you can try this function&lt;/H4&gt;&lt;H4&gt;TextBetween( &lt;SPAN style="font-style: italic;"&gt;s&lt;/SPAN&gt; , &lt;SPAN style="font-style: italic;"&gt;beforetext&lt;/SPAN&gt; , &lt;SPAN style="font-style: italic;"&gt;aftertext&lt;/SPAN&gt; [, &lt;SPAN style="font-style: italic;"&gt;n &lt;/SPAN&gt;] )&lt;/H4&gt;&lt;P&gt;Returns the text between the &lt;SPAN style="font-style: italic;"&gt;n&lt;/SPAN&gt;:th occurrence of &lt;SPAN style="font-style: italic;"&gt;beforetext&lt;/SPAN&gt; and the immediately following occurrence of &lt;SPAN style="font-style: italic;"&gt;aftertext&lt;/SPAN&gt; within the string &lt;SPAN style="font-style: italic;"&gt;s&lt;/SPAN&gt;.&lt;/P&gt;&lt;H2&gt;Examples:&lt;/H2&gt;&lt;TABLE cellspacing="0" style="margin-top: 14pt; width: 580px; margin-left: 40px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="width: 43%; padding: 7px;" valign="top" width="43%"&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;TextBetween('&amp;lt;abc&amp;gt;', '&amp;lt;', '&amp;gt;')&lt;/SPAN&gt; &lt;/P&gt;&lt;/TD&gt;&lt;TD style="width: 57%; padding: 7px;" valign="top" width="57%"&gt;&lt;P&gt;returns '&lt;SPAN style="font-style: italic;"&gt;abc&lt;/SPAN&gt;'&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 43%; padding: 7px;" valign="top" width="43%"&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;TextBetween('&amp;lt;abc&amp;gt;&amp;lt;de&amp;gt;', '&amp;lt;', '&amp;gt;',2)&lt;/SPAN&gt; &lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Nov 2011 09:25:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Split-string/m-p/257516#M97322</guid>
      <dc:creator />
      <dc:date>2011-11-26T09:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Split string</title>
      <link>https://community.qlik.com/t5/QlikView/Split-string/m-p/257517#M97323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe like this in the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TEST:&lt;/P&gt;&lt;P&gt;LOAD subfield(Test,',') as TestSubfield INLINE [&lt;/P&gt;&lt;P&gt;Test&lt;/P&gt;&lt;P&gt;"aa bb (c,c) dd,dd ss aa,ee rr ff dd"&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tmp:&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;,if(index(TestSubfield,')') and previous(index(TestSubfield,'(')), peek(TestSubfield)&amp;amp;','&amp;amp;TestSubfield,&lt;/P&gt;&lt;P&gt;if(findoneof(TestSubfield,'()')=0, TestSubfield, NULL())) as Result&lt;/P&gt;&lt;P&gt;resident TEST;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;LOAD Result resident tmp where not IsNull(Result);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop tables tmp, TEST;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Nov 2011 12:28:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Split-string/m-p/257517#M97323</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-11-26T12:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: Split string</title>
      <link>https://community.qlik.com/t5/QlikView/Split-string/m-p/257518#M97324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Stefan, this is what I were beginning with. First split and then "repair".Sorry to say that it don't work for my dataset, but I will try to refine it. Not blaming you since you only got a mockup dataset. Attaching an excel file with some data and desired outcome. Ignore Home- and Awayteam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2011 08:56:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Split-string/m-p/257518#M97324</guid>
      <dc:creator />
      <dc:date>2011-11-28T08:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: Split string</title>
      <link>https://community.qlik.com/t5/QlikView/Split-string/m-p/257519#M97325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Thomas. I have a solution that might work. See attached. Regards Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2011 09:40:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Split-string/m-p/257519#M97325</guid>
      <dc:creator>RSvebeck</dc:creator>
      <dc:date>2011-11-28T09:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Split string</title>
      <link>https://community.qlik.com/t5/QlikView/Split-string/m-p/257520#M97326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; This does the trick:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Directory;&lt;BR /&gt;TEST:&lt;BR /&gt;LOAD&lt;BR /&gt;SubField(A,',') as TestSubfield&lt;BR /&gt;FROM&lt;BR /&gt;stringTest.xlsx&lt;BR /&gt;(ooxml, no labels, table is Blad1);&lt;/P&gt;&lt;P&gt;tmp:&lt;BR /&gt;LOAD *,&lt;BR /&gt;if(previous(index(TestSubfield,'(',2))=0,TestSubfield,&lt;BR /&gt; if(index(TestSubfield,'(',2)&amp;gt;0 and previous(index(TestSubfield,'(',2))&amp;gt;0,TestSubfield,&lt;BR /&gt; if(index(TestSubfield,'(',2)=0 ,peek(TestSubfield)&amp;amp;','&amp;amp;TestSubfield,NULL()))) as Result&lt;BR /&gt;resident TEST;&lt;/P&gt;&lt;P&gt;Result:&lt;BR /&gt;LOAD Result&lt;BR /&gt; resident tmp &lt;BR /&gt;where not IsNull(Result) AND&lt;BR /&gt;SubStringCount(Result,'(')=SubStringCount(Result,')');&lt;/P&gt;&lt;P&gt;DROP tables tmp,TEST;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;I'll look at your solution as well Robert since mine probably is "ugly".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2011 10:13:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Split-string/m-p/257520#M97326</guid>
      <dc:creator />
      <dc:date>2011-11-28T10:13:40Z</dc:date>
    </item>
  </channel>
</rss>

