<?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: How to extract a delimiter in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-extract-a-delimiter/m-p/1628052#M732996</link>
    <description>&lt;P&gt;The delimiter in both subfields is the same and therefore the logic couldn't work. Personally I would follow the suggestion from Vegar to unify the different delimiter and then transferring the condition into the third parameter of the subfield, means something like this:&lt;/P&gt;&lt;P&gt;trim(subfield(replace(LOCATION, '-', ','), ',',&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if([NH Country] &amp;lt;&amp;gt; 'USA' or substringcount(LOCATION, '-'), 2, 1)))&lt;/P&gt;&lt;P&gt;Depending on the variety of your delimiter and/or the order in which the values are placed you might need to add further conditions and/or to adjust them here. If the variety of the above mentioned is quite big but there aren't really many values it might be an alternatively to create a (manually) mapping table for it and replace the values with it.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
    <pubDate>Wed, 25 Sep 2019 12:00:32 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2019-09-25T12:00:32Z</dc:date>
    <item>
      <title>How to extract a delimiter</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-extract-a-delimiter/m-p/1627875#M732993</link>
      <description>&lt;P&gt;I want to extract delimiter. I understand that Subfield function can be used if we want to get content before or after delimiter. But in my column named Location values are&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#00ff00"&gt;Boxborough, MA&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#99cc00"&gt;Brazil, Sao Paulo&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#00ff00"&gt;Bridgewater, NJ&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#ff0000"&gt;California - San Diego&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#00ff00"&gt;Canada, Markham&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Using below code in the script I am able to extract the values in green, but not the value in red&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" color="#0000ff"&gt;if&lt;/FONT&gt;&lt;FONT size="1"&gt;(&lt;/FONT&gt;&lt;FONT size="1" color="#800000"&gt;"NH Country"&lt;/FONT&gt;&lt;FONT size="1"&gt; = 'USA',&lt;/FONT&gt;&lt;FONT size="1" color="#0000ff"&gt;TRIM&lt;/FONT&gt;&lt;FONT size="1"&gt;(&lt;/FONT&gt;&lt;FONT size="1" color="#0000ff"&gt;Subfield&lt;/FONT&gt;&lt;FONT size="1"&gt;(&lt;/FONT&gt;&lt;FONT size="1" color="#800000"&gt;"LOCATION"&lt;/FONT&gt;&lt;FONT size="1"&gt;,',',1)),(&lt;/FONT&gt;&lt;FONT size="1" color="#0000ff"&gt;if&lt;/FONT&gt;&lt;FONT size="1"&gt;(&lt;/FONT&gt;&lt;FONT size="1" color="#800000"&gt;"NH Country"&lt;/FONT&gt;&lt;FONT size="1"&gt; &amp;lt;&amp;gt; 'USA',&lt;/FONT&gt;&lt;FONT size="1" color="#0000ff"&gt;TRIM&lt;/FONT&gt;&lt;FONT size="1"&gt;(&lt;/FONT&gt;&lt;FONT size="1" color="#0000ff"&gt;Subfield&lt;/FONT&gt;&lt;FONT size="1"&gt;(&lt;/FONT&gt;&lt;FONT size="1" color="#800000"&gt;"LOCATION"&lt;/FONT&gt;&lt;FONT size="1"&gt;,',',2))))) &lt;/FONT&gt;&lt;FONT size="1" color="#0000ff"&gt;AS&lt;/FONT&gt; &lt;FONT size="1" color="#800000"&gt;"PLCity"&lt;/FONT&gt;&lt;FONT size="1"&gt;, &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Can someone help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 02:24:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-extract-a-delimiter/m-p/1627875#M732993</guid>
      <dc:creator>rdsuperline</dc:creator>
      <dc:date>2024-11-16T02:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a delimiter</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-extract-a-delimiter/m-p/1627879#M732994</link>
      <description>&lt;P&gt;You could try to replace all - with a ,&amp;nbsp; before performing your trim logic.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 21:18:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-extract-a-delimiter/m-p/1627879#M732994</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-09-24T21:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a delimiter</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-extract-a-delimiter/m-p/1627884#M732995</link>
      <description>&lt;P&gt;Thanks but when there is a - I need to pick city after the delimiter and when there is , I need to pick city before , so the replace logic wont work correctly&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 21:40:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-extract-a-delimiter/m-p/1627884#M732995</guid>
      <dc:creator>rdsuperline</dc:creator>
      <dc:date>2019-09-24T21:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a delimiter</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-extract-a-delimiter/m-p/1628052#M732996</link>
      <description>&lt;P&gt;The delimiter in both subfields is the same and therefore the logic couldn't work. Personally I would follow the suggestion from Vegar to unify the different delimiter and then transferring the condition into the third parameter of the subfield, means something like this:&lt;/P&gt;&lt;P&gt;trim(subfield(replace(LOCATION, '-', ','), ',',&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if([NH Country] &amp;lt;&amp;gt; 'USA' or substringcount(LOCATION, '-'), 2, 1)))&lt;/P&gt;&lt;P&gt;Depending on the variety of your delimiter and/or the order in which the values are placed you might need to add further conditions and/or to adjust them here. If the variety of the above mentioned is quite big but there aren't really many values it might be an alternatively to create a (manually) mapping table for it and replace the values with it.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2019 12:00:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-extract-a-delimiter/m-p/1628052#M732996</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-09-25T12:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a delimiter</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-extract-a-delimiter/m-p/1631261#M732997</link>
      <description>&lt;P&gt;I may be way off-base here, but what about two different loads of the data, one where you grab all the records with the ,'s and another where you grab the -'s, that way your subsequent logic can be properly applied to each and you can then join things properly from those two Resident tables you end up having?&amp;nbsp; Apologies again if I am way off here, but from what I could gather, this seemed like a potential way to go with things given the use case.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 20:35:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-extract-a-delimiter/m-p/1631261#M732997</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-10-03T20:35:49Z</dc:date>
    </item>
  </channel>
</rss>

