<?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 splitting a string during load in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/splitting-a-string-during-load/m-p/333059#M122737</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the db/app I am building we have paid for an external mapping of string terms to a variety of "categories". The results have been returned to me in a table like this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Key Field&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Categories&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a string&lt;/TD&gt;&lt;TD&gt;[cat1,cat2]&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;another string&lt;/TD&gt;&lt;TD&gt;[cat2,cat3,cat4]&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;yet another string&lt;/TD&gt;&lt;TD&gt;[cat2, cat4]&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other string&lt;/TD&gt;&lt;TD&gt;[cat1, cat5]&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;further string&lt;/TD&gt;&lt;TD&gt;[cat2, cat4]&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The categories field rows are strings surrounded by square brackets and delimeted by ",".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to load the data so that I end up with a table like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Key Field&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Categories&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a string&lt;/TD&gt;&lt;TD&gt;cat1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a string&lt;/TD&gt;&lt;TD&gt;cat2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;another string&lt;/TD&gt;&lt;TD&gt;cat2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;another string&lt;/TD&gt;&lt;TD&gt;cat3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;another string&lt;/TD&gt;&lt;TD&gt;cat4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;yet another string&lt;/TD&gt;&lt;TD&gt;cat2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;yet another string&lt;/TD&gt;&lt;TD&gt;cat4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other string&lt;/TD&gt;&lt;TD&gt;cat1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other string&lt;/TD&gt;&lt;TD&gt;cat5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;further string&lt;/TD&gt;&lt;TD&gt;cat2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;further string&lt;/TD&gt;&lt;TD&gt;cat4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So that I am able to look at all the Key field strings associated with a certain category.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g in this case cat1 would be associated with "a string" and "other string"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you give me some pointers on how to achieve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Jul 2012 07:58:06 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-07-04T07:58:06Z</dc:date>
    <item>
      <title>splitting a string during load</title>
      <link>https://community.qlik.com/t5/QlikView/splitting-a-string-during-load/m-p/333059#M122737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the db/app I am building we have paid for an external mapping of string terms to a variety of "categories". The results have been returned to me in a table like this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Key Field&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Categories&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a string&lt;/TD&gt;&lt;TD&gt;[cat1,cat2]&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;another string&lt;/TD&gt;&lt;TD&gt;[cat2,cat3,cat4]&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;yet another string&lt;/TD&gt;&lt;TD&gt;[cat2, cat4]&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other string&lt;/TD&gt;&lt;TD&gt;[cat1, cat5]&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;further string&lt;/TD&gt;&lt;TD&gt;[cat2, cat4]&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The categories field rows are strings surrounded by square brackets and delimeted by ",".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to load the data so that I end up with a table like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Key Field&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Categories&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a string&lt;/TD&gt;&lt;TD&gt;cat1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a string&lt;/TD&gt;&lt;TD&gt;cat2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;another string&lt;/TD&gt;&lt;TD&gt;cat2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;another string&lt;/TD&gt;&lt;TD&gt;cat3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;another string&lt;/TD&gt;&lt;TD&gt;cat4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;yet another string&lt;/TD&gt;&lt;TD&gt;cat2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;yet another string&lt;/TD&gt;&lt;TD&gt;cat4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other string&lt;/TD&gt;&lt;TD&gt;cat1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other string&lt;/TD&gt;&lt;TD&gt;cat5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;further string&lt;/TD&gt;&lt;TD&gt;cat2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;further string&lt;/TD&gt;&lt;TD&gt;cat4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So that I am able to look at all the Key field strings associated with a certain category.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g in this case cat1 would be associated with "a string" and "other string"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you give me some pointers on how to achieve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2012 07:58:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/splitting-a-string-during-load/m-p/333059#M122737</guid>
      <dc:creator />
      <dc:date>2012-07-04T07:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: splitting a string during load</title>
      <link>https://community.qlik.com/t5/QlikView/splitting-a-string-during-load/m-p/333060#M122738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the SubField() function in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Subfield(Categories,',') as Categories&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might want to strip out the [ and ] as well if they are there in the data.. use Subfield(Purgechar(Categories,'[]'),',') as Categories in that case&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2012 08:42:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/splitting-a-string-during-load/m-p/333060#M122738</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-07-04T08:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: splitting a string during load</title>
      <link>https://community.qlik.com/t5/QlikView/splitting-a-string-during-load/m-p/333061#M122739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Johannes,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you know I had already tried the substring() function, and had not got it to work, but follwoing your reply, I employed it then realised that I had made an error in my script and not got the key field correct!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I correct that error and the data loaded great first time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2012 11:36:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/splitting-a-string-during-load/m-p/333061#M122739</guid>
      <dc:creator />
      <dc:date>2012-07-04T11:36:48Z</dc:date>
    </item>
  </channel>
</rss>

