<?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: Work with data in a single field, separated by comma in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Work-with-data-in-a-single-field-separated-by-comma/m-p/851672#M659540</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have a sample data? It would be much easier to show you how it works then to put it in words.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Apr 2015 12:42:12 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2015-04-03T12:42:12Z</dc:date>
    <item>
      <title>Work with data in a single field, separated by comma</title>
      <link>https://community.qlik.com/t5/QlikView/Work-with-data-in-a-single-field-separated-by-comma/m-p/851669#M659537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good day,&lt;/P&gt;&lt;P&gt;there are 2 tables&lt;/P&gt;&lt;P&gt;1) the list of services&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;id_service; - service code&lt;/P&gt;&lt;P&gt;name_service; - name of the service&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) the journal of services rendered&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;id; - code recording&lt;/P&gt;&lt;P&gt;id_service; - service code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that the developer stores data about the list of services separated by commas in a single field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;id; id_service&lt;/P&gt;&lt;P&gt;1; [1]&lt;/P&gt;&lt;P&gt;2; [1,2,3,4]&lt;/P&gt;&lt;P&gt;3; [2,1,2]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Questions&lt;/P&gt;&lt;P&gt;1) how can you count the number of services?&lt;/P&gt;&lt;P&gt;2) how you can substitute the name of the service?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your attention&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2015 12:33:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Work-with-data-in-a-single-field-separated-by-comma/m-p/851669#M659537</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-03T12:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Work with data in a single field, separated by comma</title>
      <link>https://community.qlik.com/t5/QlikView/Work-with-data-in-a-single-field-separated-by-comma/m-p/851670#M659538</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;You can use the subfield function to split id_service across multiple records. See the help file for a description of the function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that you can either use applymap or join to replace the id_service with a name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matthijs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2015 12:39:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Work-with-data-in-a-single-field-separated-by-comma/m-p/851670#M659538</guid>
      <dc:creator />
      <dc:date>2015-04-03T12:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: Work with data in a single field, separated by comma</title>
      <link>https://community.qlik.com/t5/QlikView/Work-with-data-in-a-single-field-separated-by-comma/m-p/851671#M659539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use the subfield function to split the comma separated list into values:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD id, subfield(purgechar(id_service,'[]')) as id_service&lt;/P&gt;&lt;P&gt;FROM ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can then count the number of services per id with count(id_service).&lt;/P&gt;&lt;P&gt;You can then use a mapping table to substitute the service name for the id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mapService:&lt;/P&gt;&lt;P&gt;MAPPING LOAD id_service, name_service&lt;/P&gt;&lt;P&gt;FROM ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD id, applyfield('mapService',id_service) as name_service;&lt;/P&gt;&lt;P&gt;LOAD id, subfield(purgechar(id_service,'[]')) as id_service&lt;/P&gt;&lt;P&gt;FROM ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2015 12:41:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Work-with-data-in-a-single-field-separated-by-comma/m-p/851671#M659539</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-04-03T12:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Work with data in a single field, separated by comma</title>
      <link>https://community.qlik.com/t5/QlikView/Work-with-data-in-a-single-field-separated-by-comma/m-p/851672#M659540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have a sample data? It would be much easier to show you how it works then to put it in words.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2015 12:42:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Work-with-data-in-a-single-field-separated-by-comma/m-p/851672#M659540</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-04-03T12:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Work with data in a single field, separated by comma</title>
      <link>https://community.qlik.com/t5/QlikView/Work-with-data-in-a-single-field-separated-by-comma/m-p/851673#M659541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, thank for the prompt&lt;/P&gt;&lt;P&gt;You really helped&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2015 12:52:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Work-with-data-in-a-single-field-separated-by-comma/m-p/851673#M659541</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-03T12:52:37Z</dc:date>
    </item>
  </channel>
</rss>

