<?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: Parse a field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Parse-a-field/m-p/460139#M702136</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume you need to parse the file name into a certain field, and then the parts of your hierarchy in other fields.&lt;/P&gt;&lt;P&gt;You can use negative indices with subfield to access the partial strings starting from the back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD *, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SubField(Detail,'/',-1) as Filename_Test,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If(substringcount(Detail,'/')&amp;gt;1,SubField(Detail,'/',2)) as Folder1,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If(substringcount(Detail,'/')&amp;gt;2,SubField(Detail,'/',3)) as Folder2,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If(substringcount(Detail,'/')&amp;gt;3,SubField(Detail,'/',4)) as Folder3,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If(substringcount(Detail,'/')&amp;gt;4,SubField(Detail,'/',5)) as Folder4,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If(substringcount(Detail,'/')&amp;gt;5,SubField(Detail,'/',6)) as Folder5;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD * INLINE [&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Detail&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;/Folder1/Folder2/Folder3/Folder4/FileName&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;/Folder1b/Folder2b/FileNameb&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Oct 2012 14:50:21 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2012-10-02T14:50:21Z</dc:date>
    <item>
      <title>Parse a field</title>
      <link>https://community.qlik.com/t5/QlikView/Parse-a-field/m-p/460136#M702133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I have a field, we'll call it Detail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to separate the field into different parts. The field contains a folder structure. So it may look something like this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/Folder1/Folder2/Folder3/Folder4/FileName/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to separate each part of the structure into its own field so I can choose them individually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I already tried the subfield function like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;subfield(Detail,'/',1) as Detail_Test1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This seems to work to bring the last part of the folder structure back. But I'm unsure how to get the rest. I tried changing 1 to 2,3,etc but it doesn't show me the correct data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 14:23:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Parse-a-field/m-p/460136#M702133</guid>
      <dc:creator />
      <dc:date>2012-10-02T14:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: Parse a field</title>
      <link>https://community.qlik.com/t5/QlikView/Parse-a-field/m-p/460137#M702134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Subfield should return you the parts of your string:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD *, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SubField(Detail,'/',2) as Test1,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SubField(Detail,'/',3) as Test2,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SubField(Detail,'/',4) as Test3,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SubField(Detail,'/',5) as Test4,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SubField(Detail,'/',6) as Test5;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD * INLINE [&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Detail&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;/Folder1/Folder2/Folder3/Folder4/FileName/&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you always coping with same depth of your hierarchy?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 14:36:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Parse-a-field/m-p/460137#M702134</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-10-02T14:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: Parse a field</title>
      <link>https://community.qlik.com/t5/QlikView/Parse-a-field/m-p/460138#M702135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not. Could that be the problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some are only two folders deep, some may be 4 or 5.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 14:40:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Parse-a-field/m-p/460138#M702135</guid>
      <dc:creator />
      <dc:date>2012-10-02T14:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Parse a field</title>
      <link>https://community.qlik.com/t5/QlikView/Parse-a-field/m-p/460139#M702136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume you need to parse the file name into a certain field, and then the parts of your hierarchy in other fields.&lt;/P&gt;&lt;P&gt;You can use negative indices with subfield to access the partial strings starting from the back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD *, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SubField(Detail,'/',-1) as Filename_Test,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If(substringcount(Detail,'/')&amp;gt;1,SubField(Detail,'/',2)) as Folder1,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If(substringcount(Detail,'/')&amp;gt;2,SubField(Detail,'/',3)) as Folder2,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If(substringcount(Detail,'/')&amp;gt;3,SubField(Detail,'/',4)) as Folder3,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If(substringcount(Detail,'/')&amp;gt;4,SubField(Detail,'/',5)) as Folder4,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If(substringcount(Detail,'/')&amp;gt;5,SubField(Detail,'/',6)) as Folder5;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD * INLINE [&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Detail&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;/Folder1/Folder2/Folder3/Folder4/FileName&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;/Folder1b/Folder2b/FileNameb&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 14:50:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Parse-a-field/m-p/460139#M702136</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-10-02T14:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Parse a field</title>
      <link>https://community.qlik.com/t5/QlikView/Parse-a-field/m-p/460140#M702137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was putting the subfield into the wrong resident load in my script. So this works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 15:08:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Parse-a-field/m-p/460140#M702137</guid>
      <dc:creator />
      <dc:date>2012-10-02T15:08:07Z</dc:date>
    </item>
  </channel>
</rss>

