<?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: Subfield with consecutive delimiters - a bug? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777455#M664169</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you give me an example of a &lt;EM&gt;data processing&lt;/EM&gt; language that eats consecutive delimiters? Let me translate your example into something that&lt;SPAN style="font-size: 13.3333330154419px;"&gt; for Subfield()&lt;/SPAN&gt; is 100% identical:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'courier new', courier;"&gt;abcdef,,,,MyData,zzzz&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;This tells me that there are 6 fields in your string and that three of them are blank. It would be awfully difficult to split a line like this if SubField would exhibit the behavior you prefer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW I cannot reproduce your results. Whatever I do, SubField() never returns spaces if a space itself is the delimiter. See also Rob's comment below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="SubFieldSplitsOnSpaces thread149791.jpg" class="image-1 jive-image" src="/legacyfs/online/76413_SubFieldSplitsOnSpaces thread149791.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Jan 2015 22:59:13 GMT</pubDate>
    <dc:creator>Peter_Cammaert</dc:creator>
    <dc:date>2015-01-27T22:59:13Z</dc:date>
    <item>
      <title>Subfield with consecutive delimiters - a bug?</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777448#M664162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I have a string with the occasional multiple delimiters between data, Subfield extracts the delimiter and not the expected data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt; =subfield('abcdef&amp;nbsp;&amp;nbsp;&amp;nbsp; MyData zzzz', ' ' , 2)&lt;/P&gt;&lt;P&gt;I expect the above to return 'MyData', but it returns ' ' (a space)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;I could use the following very ugly statement, but I'm not thrilled about doing so, especially since this needs to be done during a load.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;=Subfield(TRIM( MID(&lt;SPAN style="font-size: 13.3333330154419px;"&gt;'abcdef&amp;nbsp;&amp;nbsp;&amp;nbsp; MyData &lt;SPAN style="font-size: 13.3333330154419px;"&gt;zzzz&lt;/SPAN&gt;',&lt;/SPAN&gt;INDEX(&lt;SPAN style="font-size: 13.3333330154419px;"&gt;'abcdef&amp;nbsp;&amp;nbsp;&amp;nbsp; MyData &lt;SPAN style="font-size: 13.3333330154419px;"&gt;zzzz&lt;/SPAN&gt;',' ',1)) ),' ',1)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on my experience with many other languages, I expected the subfield to eat the extra consecutive&amp;nbsp; delimiters, but that is not happening.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q1) is this the expected Subfield behavior or a bug?&lt;/P&gt;&lt;P&gt;Q2) Does anyone have a better method than my above expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TIA,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;QV 11.20, SR4&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 19:50:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777448#M664162</guid>
      <dc:creator />
      <dc:date>2015-01-27T19:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with consecutive delimiters - a bug?</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777449#M664163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Your expression ends with ",2" so is asking to extract the data before the second delimiter, hence blank is returned &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;To get the first value use.&amp;nbsp;&amp;nbsp; =subfield('abcdef&amp;nbsp;&amp;nbsp;&amp;nbsp; MyData zzzz', ' ' , 1)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 20:36:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777449#M664163</guid>
      <dc:creator>Colin-Albert</dc:creator>
      <dc:date>2015-01-27T20:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with consecutive delimiters - a bug?</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777450#M664164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use replace to remove the double spaces. &lt;/P&gt;&lt;P&gt;You may need to use replace more than once if three or more spaces have been entered&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=subfield( replace(replace(replace('abcdef&amp;nbsp;&amp;nbsp;&amp;nbsp; MyData zzzz'), '&amp;nbsp; ',' '), '&amp;nbsp; ',' '), '&amp;nbsp; ', ' '), ' ' , 2)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 20:41:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777450#M664164</guid>
      <dc:creator>Colin-Albert</dc:creator>
      <dc:date>2015-01-27T20:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with consecutive delimiters - a bug?</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777451#M664165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In other programming languages I've used, similar functions eat the consecutive delimiters and that was my expectation with this language.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree that the next character after the first delimiter is a space and that is what it returns.&amp;nbsp; &lt;/P&gt;&lt;P&gt;I disagree with how QV has implemented the SubField function.&amp;nbsp; I believe it should return the first non-delimiter character.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 20:48:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777451#M664165</guid>
      <dc:creator />
      <dc:date>2015-01-27T20:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with consecutive delimiters - a bug?</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777452#M664166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So far, I've only seen two spaces between the substrings, but this is human entered data, so I do not dare make assumptions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea of of the efficiency of replace vs trim / mid / index?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 20:50:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777452#M664166</guid>
      <dc:creator />
      <dc:date>2015-01-27T20:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with consecutive delimiters - a bug?</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777453#M664167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure it returns an actual space and not an empty string? My tests show that it returns an empty string, which is what I would expect. I use a mapping table to squeeze out extra blanks when I need to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SpaceMap:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;MAPPING LOAD repeat(' ',recno()+1) , ' '&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;AutoGenerate 10&amp;nbsp;&amp;nbsp; // Squeeze up to 11 blanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD subfield( MapSubstring('SpaceMap', myfield), ' ',2) as ....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com/" rel="nofollow"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://robwunderlich.com/" rel="nofollow"&gt;http://robwunderlich.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 21:08:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777453#M664167</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-01-27T21:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with consecutive delimiters - a bug?</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777454#M664168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may disagree with how QlikView has implemented subfield, but it works according to the documentation and is unlikely to change.&lt;/P&gt;&lt;P&gt;You can have mulltiple characters as the delimiter and subfield works correctly, but subfield does not support variable length delimiters. If the delimiter length varies, then you will need to correct this before passing the data to the subfield command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot comment on whether using replace is more efficient than trim/mid/index, but replace is simpler to implement, especially where numerous delimiters may exist.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 21:10:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777454#M664168</guid>
      <dc:creator>Colin-Albert</dc:creator>
      <dc:date>2015-01-27T21:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with consecutive delimiters - a bug?</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777455#M664169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you give me an example of a &lt;EM&gt;data processing&lt;/EM&gt; language that eats consecutive delimiters? Let me translate your example into something that&lt;SPAN style="font-size: 13.3333330154419px;"&gt; for Subfield()&lt;/SPAN&gt; is 100% identical:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'courier new', courier;"&gt;abcdef,,,,MyData,zzzz&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;This tells me that there are 6 fields in your string and that three of them are blank. It would be awfully difficult to split a line like this if SubField would exhibit the behavior you prefer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW I cannot reproduce your results. Whatever I do, SubField() never returns spaces if a space itself is the delimiter. See also Rob's comment below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="SubFieldSplitsOnSpaces thread149791.jpg" class="image-1 jive-image" src="/legacyfs/online/76413_SubFieldSplitsOnSpaces thread149791.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 22:59:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777455#M664169</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-01-27T22:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with consecutive delimiters - a bug?</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777456#M664170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Subfiled is doing its job as it should.&lt;/P&gt;&lt;P&gt;What surprised me that&amp;nbsp; TRIM does not do the job.&lt;/P&gt;&lt;P&gt;It "should" (I expected that as Excel do it this way) cut all additional spaces after each word but is only removing empties for whole sentence.&lt;/P&gt;&lt;P&gt;If TRIM was working as in Excel there was no need to use additional functions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 05:12:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777456#M664170</guid>
      <dc:creator>robert_mika</dc:creator>
      <dc:date>2015-01-28T05:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with consecutive delimiters - a bug?</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777457#M664171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In QlikView TRIM removes leading and trailing spaces from a string. It does not remove spaces within a string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Excel, trim removes all spaces from a string except for a single space between words.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QlikView is not excel, both have a trim function, but they produce different results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The F1 help defines the syntax and function of an expression, different languages have subtle differences between similar commands, you cannot assume that functionality will be identical in different programming languages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QlikView Trim is doing its job as it should, but this is not the same as trim in Excel..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 07:14:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777457#M664171</guid>
      <dc:creator>Colin-Albert</dc:creator>
      <dc:date>2015-01-28T07:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with consecutive delimiters - a bug?</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777458#M664172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Neither it's bug nor it's expression issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's actually happening due to, you are using double space in expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;Correct:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=subfield('abcdef MyData zzzz', ' ' , 2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Your script with spaces:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=subfield('abcdef&amp;nbsp;&amp;nbsp;&amp;nbsp; MyData zzzz', ' ' , 2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Ishfaque Ahmed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 07:24:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777458#M664172</guid>
      <dc:creator>engishfaque</dc:creator>
      <dc:date>2015-01-28T07:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with consecutive delimiters - a bug?</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777459#M664173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are right Colin.&lt;/P&gt;&lt;P&gt;Thanks for the explanation&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 07:31:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777459#M664173</guid>
      <dc:creator>robert_mika</dc:creator>
      <dc:date>2015-01-28T07:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with consecutive delimiters - a bug?</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777460#M664174</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;as John stated it's human entered data, I tried to extend your solution to work with any number of spaces (for John's users with itchy fingers &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_149791_Pic1.JPG" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/76520_QlikCommunity_Thread_149791_Pic1.JPG" style="height: auto;" /&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_14224803630868655" jivemacro_uid="_14224803630868655"&gt;
&lt;P&gt;tabStrings:&lt;/P&gt;
&lt;P&gt;LOAD *,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RecNo() as ID&lt;/P&gt;
&lt;P&gt;Inline [&lt;/P&gt;
&lt;P&gt;string&lt;/P&gt;
&lt;P&gt;abcdef&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyData&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zzzz&lt;/P&gt;
&lt;P&gt;abcdef&amp;nbsp;&amp;nbsp;&amp;nbsp; MyData zzzz&lt;/P&gt;
&lt;P&gt;abcdef&amp;nbsp;&amp;nbsp;&amp;nbsp; MyData zzzz&lt;/P&gt;
&lt;P&gt;abcdef&amp;nbsp; MyData zzzz&lt;/P&gt;
&lt;P&gt;abcdef&amp;nbsp; MyData zzzz&lt;/P&gt;
&lt;P&gt;abcdef MyData zzzz&lt;/P&gt;
&lt;P&gt;abcdef&amp;nbsp;&amp;nbsp;&amp;nbsp; MyData&amp;nbsp; zzzz&lt;/P&gt;
&lt;P&gt;abcdef&amp;nbsp;&amp;nbsp;&amp;nbsp; MyData&amp;nbsp; zzzz&lt;/P&gt;
&lt;P&gt;abcdef&amp;nbsp; MyData&amp;nbsp; zzzz&lt;/P&gt;
&lt;P&gt;abcdef&amp;nbsp; MyData&amp;nbsp; zzzz&lt;/P&gt;
&lt;P&gt;abcdef MyData&amp;nbsp; zzzz&lt;/P&gt;
&lt;P&gt;abcdef&amp;nbsp;&amp;nbsp;&amp;nbsp; MyData&amp;nbsp; zzzz&lt;/P&gt;
&lt;P&gt;abcdef&amp;nbsp;&amp;nbsp;&amp;nbsp; MyData&amp;nbsp; zzzz&lt;/P&gt;
&lt;P&gt;abcdef&amp;nbsp; MyData&amp;nbsp; zzzz&lt;/P&gt;
&lt;P&gt;abcdef&amp;nbsp; MyData&amp;nbsp; zzzz&lt;/P&gt;
&lt;P&gt;abcdef MyData&amp;nbsp; zzzz&lt;/P&gt;
&lt;P&gt;abcdef&amp;nbsp;&amp;nbsp;&amp;nbsp; MyData&amp;nbsp;&amp;nbsp;&amp;nbsp; zzzz&lt;/P&gt;
&lt;P&gt;abcdef&amp;nbsp;&amp;nbsp;&amp;nbsp; MyData&amp;nbsp;&amp;nbsp;&amp;nbsp; zzzz&lt;/P&gt;
&lt;P&gt;abcdef&amp;nbsp; MyData&amp;nbsp;&amp;nbsp;&amp;nbsp; zzzz&lt;/P&gt;
&lt;P&gt;abcdef&amp;nbsp; MyData&amp;nbsp;&amp;nbsp;&amp;nbsp; zzzz&lt;/P&gt;
&lt;P&gt;abcdef MyData&amp;nbsp;&amp;nbsp;&amp;nbsp; zzzz&lt;/P&gt;
&lt;P&gt;abcdef&amp;nbsp;&amp;nbsp;&amp;nbsp; MyData&amp;nbsp;&amp;nbsp;&amp;nbsp; zzzz&lt;/P&gt;
&lt;P&gt;abcdef&amp;nbsp;&amp;nbsp;&amp;nbsp; MyData&amp;nbsp;&amp;nbsp;&amp;nbsp; zzzz&lt;/P&gt;
&lt;P&gt;abcdef&amp;nbsp; MyData&amp;nbsp;&amp;nbsp;&amp;nbsp; zzzz&lt;/P&gt;
&lt;P&gt;abcdef&amp;nbsp; MyData&amp;nbsp;&amp;nbsp;&amp;nbsp; zzzz&lt;/P&gt;
&lt;P&gt;abcdef MyData&amp;nbsp;&amp;nbsp;&amp;nbsp; zzzz&lt;/P&gt;
&lt;P&gt;aa bb cc&lt;/P&gt;
&lt;P&gt;aa&amp;nbsp; bb cc&lt;/P&gt;
&lt;P&gt;aa bb&amp;nbsp; cc&lt;/P&gt;
&lt;P&gt;aaa bb&amp;nbsp; cc&lt;/P&gt;
&lt;P&gt;aaa&amp;nbsp; bb cc&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;SpaceMap:&lt;/P&gt;
&lt;P&gt;MAPPING LOAD Repeat(' ',IterNo()+1) , ' '&lt;/P&gt;
&lt;P&gt;While IterNo()&amp;lt;MaxSpaces;&lt;/P&gt;
&lt;P&gt;LOAD Max(IterNo) as MaxSpaces;&lt;/P&gt;
&lt;P&gt;LOAD IterNo() as IterNo&lt;/P&gt;
&lt;P&gt;Resident tabStrings&lt;/P&gt;
&lt;P&gt;While Index(string, Repeat(' ',IterNo())) or IterNo()=1;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Left Join (tabStrings)&lt;/P&gt;
&lt;P&gt;LOAD Distinct&lt;/P&gt;
&lt;P&gt;&amp;nbsp; string,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SubField(MapSubString('SpaceMap', string),' ',2) as SubString2&lt;/P&gt;
&lt;P&gt;Resident tabStrings;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope 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>Wed, 28 Jan 2015 21:26:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777460#M664174</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2015-01-28T21:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with consecutive delimiters - a bug?</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777461#M664175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Clever Marco. But wouldn't you agree that &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier;"&gt;&amp;nbsp; AutoGenerate 9999&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;is easier to read and faster? &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 22:08:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777461#M664175</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-01-28T22:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with consecutive delimiters - a bug?</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777462#M664176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, indeed. Good point &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/blush.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe it just proves that one could create a generic solution without assumptions,&lt;/P&gt;&lt;P&gt;even if it's not very practical for a productive solution ...&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>Wed, 28 Jan 2015 22:16:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777462#M664176</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2015-01-28T22:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with consecutive delimiters - a bug?</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777463#M664177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I like your thinking.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 22:18:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777463#M664177</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-01-28T22:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with consecutive delimiters - a bug?</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777464#M664178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Colin,&lt;/P&gt;&lt;P&gt;I do have to back of somewhat on my sweeping statement about eating delimiters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like and expect a split / subfield command to treat consecutive 'space' delimiters as one delimiter, but I do not want the command to treat consecutive non-space delimiters (such as commas) as one delimiter.&lt;/P&gt;&lt;P&gt;JLR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2015 01:06:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777464#M664178</guid>
      <dc:creator />
      <dc:date>2015-01-29T01:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with consecutive delimiters - a bug?</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777465#M664179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Peter,&lt;/P&gt;&lt;P&gt;Java, PHP, C, Perl, Python, etc ... all have a variation on the following: &lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;SPAN class="pln"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; s&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;split&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str"&gt;" +"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;);&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But they use a regular expression to split the string, which is not available to us in QV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;SPAN class="pun"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;SPAN class="pun"&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2015 01:18:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777465#M664179</guid>
      <dc:creator />
      <dc:date>2015-01-29T01:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with consecutive delimiters - a bug?</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777466#M664180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;re: Excel's trim - I did not know that. strange.&amp;nbsp; Not sure I like that.&amp;nbsp; &lt;BR /&gt;QV's trim functions as I expect - trim leading / trailing spaces and does nothing to the body of the string.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2015 01:20:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777466#M664180</guid>
      <dc:creator />
      <dc:date>2015-01-29T01:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with consecutive delimiters - a bug?</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777467#M664181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting - yet another way to fix the issue.&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(And Rob, thanks for your "Cookbook".&amp;nbsp; It has been helpful).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2015 01:23:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-consecutive-delimiters-a-bug/m-p/777467#M664181</guid>
      <dc:creator />
      <dc:date>2015-01-29T01:23:35Z</dc:date>
    </item>
  </channel>
</rss>

