<?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 space as delimeter in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Subfield-with-space-as-delimeter/m-p/1593174#M596796</link>
    <description>&lt;P&gt;It's not about the unequal length, it's because there is more than one space between the values. Basically Subfield(Var0,' ',2) will return what's between the first and second space (the character). And obviously there is nothing there because one is right after the other &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You could preprocess the values so the consecutive spaces are collapsed to a single one. There is no inbuilt function to do this (that I know) but you could create a map:&lt;/P&gt;&lt;P&gt;map:&lt;BR /&gt;MAPPING LOAD&lt;BR /&gt;Repeat(' ', RecNo()),&lt;BR /&gt;' '&lt;BR /&gt;Autogenerate 10; // 10 is the maximum number of consecutive spaces you can have, raise as needed&lt;/P&gt;&lt;P&gt;and then apply it using MapSubstring function:&lt;BR /&gt;MapSubstring('map', Var0)&lt;BR /&gt;&lt;BR /&gt;You can either wrap this with individual Subfield() calls or do a initial load just for collapsing the spaces and do the Subfield in a preceding load or a resident load.&lt;/P&gt;</description>
    <pubDate>Tue, 18 Jun 2019 15:37:24 GMT</pubDate>
    <dc:creator>kuba_michalik</dc:creator>
    <dc:date>2019-06-18T15:37:24Z</dc:date>
    <item>
      <title>Subfield with space as delimeter</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-space-as-delimeter/m-p/1593160#M596794</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;In my table, I have a field having values with this kind of syntax:&lt;/P&gt;&lt;P&gt;Var0= T025798&amp;nbsp;&amp;nbsp;&amp;nbsp; 2019 194918225&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MOTO AME&lt;/P&gt;&lt;P&gt;I would like to recuperate in a variable each value.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;For example: Var1=T025798 &amp;amp; Var2=2019 &amp;amp; Var3=194918225 etc.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;So I tried the function subfield in my script:&lt;/P&gt;&lt;P&gt;SubField(Var0,' ',1) AS Var1,&lt;/P&gt;&lt;P&gt;SubField(Var0,' ',2) AS Var2,&lt;/P&gt;&lt;P&gt;SubField(Var0,' ',3) AS Var3,&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;But I obtain a result only for the first, Var1.&amp;nbsp; I think that this is due because the length between the values is not equal.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please could you help me to resolve my problem.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance for your help.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:15:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-space-as-delimeter/m-p/1593160#M596794</guid>
      <dc:creator>Black_Hole</dc:creator>
      <dc:date>2024-11-16T03:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with space as delimeter</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-space-as-delimeter/m-p/1593171#M596795</link>
      <description>Seems like either subfield or left/right should get you the result you're looking for.&lt;BR /&gt;&lt;BR /&gt;Can you share sample data?</description>
      <pubDate>Tue, 18 Jun 2019 15:35:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-space-as-delimeter/m-p/1593171#M596795</guid>
      <dc:creator>awaisqureshi</dc:creator>
      <dc:date>2019-06-18T15:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with space as delimeter</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-space-as-delimeter/m-p/1593174#M596796</link>
      <description>&lt;P&gt;It's not about the unequal length, it's because there is more than one space between the values. Basically Subfield(Var0,' ',2) will return what's between the first and second space (the character). And obviously there is nothing there because one is right after the other &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You could preprocess the values so the consecutive spaces are collapsed to a single one. There is no inbuilt function to do this (that I know) but you could create a map:&lt;/P&gt;&lt;P&gt;map:&lt;BR /&gt;MAPPING LOAD&lt;BR /&gt;Repeat(' ', RecNo()),&lt;BR /&gt;' '&lt;BR /&gt;Autogenerate 10; // 10 is the maximum number of consecutive spaces you can have, raise as needed&lt;/P&gt;&lt;P&gt;and then apply it using MapSubstring function:&lt;BR /&gt;MapSubstring('map', Var0)&lt;BR /&gt;&lt;BR /&gt;You can either wrap this with individual Subfield() calls or do a initial load just for collapsing the spaces and do the Subfield in a preceding load or a resident load.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 15:37:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-space-as-delimeter/m-p/1593174#M596796</guid>
      <dc:creator>kuba_michalik</dc:creator>
      <dc:date>2019-06-18T15:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with space as delimeter</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-space-as-delimeter/m-p/1593189#M596797</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28006"&gt;@kuba_michalik&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/76515"&gt;@awaisqureshi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/76515"&gt;@awaisqureshi&lt;/a&gt;&amp;nbsp;:&amp;nbsp; I put a sample in the attached file.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28006"&gt;@kuba_michalik&lt;/a&gt;&amp;nbsp;: I will try to see if I can resolve my problem in this way.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you in advance for your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 15:55:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-space-as-delimeter/m-p/1593189#M596797</guid>
      <dc:creator>Black_Hole</dc:creator>
      <dc:date>2019-06-18T15:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with space as delimeter</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-space-as-delimeter/m-p/1593218#M596798</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/66319"&gt;@Black_Hole&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28006"&gt;@kuba_michalik&lt;/a&gt;'s suggestion applied to your needs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;map:
Mapping
LOAD
Repeat(' ', RecNo()),
' '
Autogenerate 10; // 10 is the maximum number of consecutive spaces you can have, raise as needed


Table1:
LOAD
MapSubString('map', VOUCHER_TEXT) as Var0,
subfield(MapSubString('map', VOUCHER_TEXT),' ',1) as Var1,
subfield(MapSubString('map', VOUCHER_TEXT),' ',2) as Var2,
subfield(MapSubString('map', VOUCHER_TEXT),' ',3) as Var3
FROM [directory];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 17:03:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-space-as-delimeter/m-p/1593218#M596798</guid>
      <dc:creator>awaisqureshi</dc:creator>
      <dc:date>2019-06-18T17:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield with space as delimeter</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield-with-space-as-delimeter/m-p/1593494#M596799</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28006"&gt;@kuba_michalik&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/76515"&gt;@awaisqureshi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I tried the solution using the function Autogenerate 10 with my file and it's a great success !&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/76515"&gt;@awaisqureshi&lt;/a&gt;&amp;nbsp; for taking the time to apply the &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28006"&gt;@kuba_michalik&lt;/a&gt;'s solution to my case.&lt;/P&gt;&lt;P&gt;Thank you very much for your help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 10:40:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield-with-space-as-delimeter/m-p/1593494#M596799</guid>
      <dc:creator>Black_Hole</dc:creator>
      <dc:date>2019-06-19T10:40:22Z</dc:date>
    </item>
  </channel>
</rss>

