<?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: Split field name into mulitple fields (inconsistent string length) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Split-field-name-into-mulitple-fields-inconsistent-string-length/m-p/918035#M318268</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Which part of the String&amp;nbsp; is the Package Type?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jul 2015 13:40:43 GMT</pubDate>
    <dc:creator>robert_mika</dc:creator>
    <dc:date>2015-07-28T13:40:43Z</dc:date>
    <item>
      <title>Split field name into mulitple fields (inconsistent string length)</title>
      <link>https://community.qlik.com/t5/QlikView/Split-field-name-into-mulitple-fields-inconsistent-string-length/m-p/918031#M318264</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;I have a field called '&lt;STRONG&gt;Title&lt;/STRONG&gt;' which is basically a long string which I want to split up and label as a number of different fields in the load script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Package Type&lt;/P&gt;&lt;P&gt;Client Name&lt;/P&gt;&lt;P&gt;Country&lt;/P&gt;&lt;P&gt;Job Number&lt;/P&gt;&lt;P&gt;PO Number&lt;/P&gt;&lt;P&gt;Step&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The string is in the form of a URL which comes in 3 types with all of the fields separated by '\' or '/' (in the case of Type 3):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Type 1:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Package Type:&lt;/STRONG&gt; \\&lt;STRONG&gt;Link Name&lt;/STRONG&gt;\&lt;STRONG&gt;Folder&lt;/STRONG&gt;\&lt;STRONG&gt;Client Name&lt;/STRONG&gt;\&lt;STRONG&gt;Job Number&lt;/STRONG&gt;\&lt;STRONG&gt;Process&lt;/STRONG&gt;\&lt;STRONG&gt;Step&lt;/STRONG&gt;\&lt;STRONG&gt;Country&lt;/STRONG&gt;\&lt;STRONG&gt;PO Number&lt;/STRONG&gt;\&lt;STRONG&gt;Source&lt;/STRONG&gt;\&lt;STRONG&gt;Job Number-PO Number.fileextension&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Type 2:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Package Type:&lt;/STRONG&gt; \\&lt;STRONG&gt;Link Name&lt;/STRONG&gt;\&lt;STRONG&gt;Master Folder&lt;/STRONG&gt;\&lt;STRONG&gt;Folder&lt;/STRONG&gt;\&lt;STRONG&gt;Sub-Folder&lt;/STRONG&gt;\&lt;STRONG&gt;Client Name&lt;/STRONG&gt;\&lt;STRONG&gt;Job Number&lt;/STRONG&gt;\&lt;STRONG&gt;Process&lt;/STRONG&gt;\&lt;STRONG&gt;Step&lt;/STRONG&gt;\&lt;STRONG&gt;Country&lt;/STRONG&gt;\&lt;STRONG&gt;PO Number&lt;/STRONG&gt;\&lt;STRONG&gt;Source&lt;/STRONG&gt;\&lt;STRONG&gt;Job Number-PO Number.fileextension&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Type 3:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Package Type:&lt;/STRONG&gt; ////&lt;STRONG&gt;System&lt;/STRONG&gt;/&lt;STRONG&gt;Tool&lt;/STRONG&gt;/&lt;STRONG&gt;Tool&lt;/STRONG&gt;/&lt;STRONG&gt;Data&lt;/STRONG&gt;/&lt;STRONG&gt;Log Number&lt;/STRONG&gt;/&lt;STRONG&gt;Log ID&lt;/STRONG&gt;/&lt;STRONG&gt;Upload Type&lt;/STRONG&gt;/&lt;STRONG&gt;PO Number&lt;/STRONG&gt;/&lt;STRONG&gt;Timestamp&lt;/STRONG&gt;/&lt;STRONG&gt;Text-Job Number-PO Number.fileextension&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first two types are downloads&amp;nbsp; which is why they are similar in structure, with just a couple of additional folder fields in the string for Type 2. they will have the same &lt;STRONG&gt;Package Type&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Type 3 is a download so the &lt;STRONG&gt;Package Type&lt;/STRONG&gt; will differ, but it is linked to the first two by &lt;STRONG&gt;PO Number&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The strings all come in a single list as one field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Given that the string lengths can be inconsistent, is there a way to cut them to define multiple fields in the script? I have thought about using the number of backslashes or forwardslashes, which will always be consistent based on the &lt;STRONG&gt;Package Type&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried using the Mid function, but as the names of the internal fields can differ in length, it won't work consistently.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 13:21:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Split-field-name-into-mulitple-fields-inconsistent-string-length/m-p/918031#M318264</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-28T13:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Split field name into mulitple fields (inconsistent string length)</title>
      <link>https://community.qlik.com/t5/QlikView/Split-field-name-into-mulitple-fields-inconsistent-string-length/m-p/918032#M318265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use&lt;/P&gt;&lt;P&gt;subfield function it will work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="syntax"&gt;&lt;A name="kanchor1300"&gt;&lt;/A&gt;&lt;A class="Bold" name="subfield"&gt;subfield&lt;/A&gt;&lt;SPAN class="Bold"&gt;(&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;s, 'delimiter' [ , index ] &lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;In its three-parameter version, this script function returns a given substring from a larger string &lt;SPAN class="Italic"&gt;s&lt;/SPAN&gt; with delimiter &lt;SPAN class="Italic"&gt;'delimiter'&lt;/SPAN&gt;. &lt;SPAN class="Italic"&gt;index&lt;/SPAN&gt; is an optional integer denoting which of the substrings should be returned. If &lt;SPAN class="Italic"&gt;index&lt;/SPAN&gt; is omitted when&lt;SPAN style="font-weight: bold;"&gt; subfield&lt;/SPAN&gt; is used in a field expression in a &lt;SPAN style="font-weight: bold;"&gt;load&lt;/SPAN&gt; statement, the &lt;SPAN style="font-weight: bold;"&gt;subfield&lt;/SPAN&gt; function will cause the &lt;SPAN style="font-weight: bold;"&gt;load&lt;/SPAN&gt; statement to automatically generate one full record of input data for each substring that can be found in &lt;SPAN style="font-style: italic;"&gt;s&lt;/SPAN&gt;. &lt;/P&gt;&lt;P&gt;In its two-parameter version, the &lt;SPAN style="font-weight: bold;"&gt;subfield&lt;/SPAN&gt; function generates one record for each substring that can be taken from a larger string &lt;SPAN class="Italic"&gt;s&lt;/SPAN&gt; with the delimiter &lt;SPAN class="Italic"&gt;'delimiter'&lt;/SPAN&gt;. If several &lt;SPAN style="font-weight: bold;"&gt;subfield&lt;/SPAN&gt; functions are used in the same &lt;SPAN style="font-weight: bold;"&gt;load&lt;/SPAN&gt; statement, the Cartesian product of all combinations will be generated. &lt;/P&gt;&lt;P class="example"&gt;Examples:&lt;/P&gt;&lt;P&gt;(For three parameters)&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;subfield(S, ';' ,2)&lt;/SPAN&gt; returns '&lt;SPAN class="Italic"&gt;cde&lt;/SPAN&gt;' if S is '&lt;SPAN class="Italic"&gt;abc&lt;/SPAN&gt;;&lt;SPAN class="Italic"&gt;cde&lt;/SPAN&gt;;&lt;SPAN class="Italic"&gt;efg&lt;/SPAN&gt;'&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;subfield(S, ';' ,1)&lt;/SPAN&gt; returns NULL if S is an empty string&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;subfield(S, ';' ,1)&lt;/SPAN&gt; returns an empty string if S is ';'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 13:24:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Split-field-name-into-mulitple-fields-inconsistent-string-length/m-p/918032#M318265</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2015-07-28T13:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Split field name into mulitple fields (inconsistent string length)</title>
      <link>https://community.qlik.com/t5/QlikView/Split-field-name-into-mulitple-fields-inconsistent-string-length/m-p/918033#M318266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Colin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Upload some QVW with sample data . That is much better&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Vishi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 13:26:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Split-field-name-into-mulitple-fields-inconsistent-string-length/m-p/918033#M318266</guid>
      <dc:creator />
      <dc:date>2015-07-28T13:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: Split field name into mulitple fields (inconsistent string length)</title>
      <link>https://community.qlik.com/t5/QlikView/Split-field-name-into-mulitple-fields-inconsistent-string-length/m-p/918034#M318267</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 try SubField() to split the string into multiple values/fields. If possible can you attach sample data and your expected output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 13:32:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Split-field-name-into-mulitple-fields-inconsistent-string-length/m-p/918034#M318267</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2015-07-28T13:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Split field name into mulitple fields (inconsistent string length)</title>
      <link>https://community.qlik.com/t5/QlikView/Split-field-name-into-mulitple-fields-inconsistent-string-length/m-p/918035#M318268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Which part of the String&amp;nbsp; is the Package Type?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 13:40:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Split-field-name-into-mulitple-fields-inconsistent-string-length/m-p/918035#M318268</guid>
      <dc:creator>robert_mika</dc:creator>
      <dc:date>2015-07-28T13:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: Split field name into mulitple fields (inconsistent string length)</title>
      <link>https://community.qlik.com/t5/QlikView/Split-field-name-into-mulitple-fields-inconsistent-string-length/m-p/918036#M318269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use a combination of subfield and replace functions to get to your results.&lt;/P&gt;&lt;P&gt;Please try the following script&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;PackageType,&lt;/P&gt;&lt;P&gt;Value,&lt;/P&gt;&lt;P&gt;SubStringCount(Value2,'|') as x,&lt;/P&gt;&lt;P&gt;if (SubStringCount(Value2,'|')=11,SubField(Value2,'|',5),if(SubStringCount(Value2,'|')=13,SubField(Value2,'|',7),'')) as ClientName,&lt;/P&gt;&lt;P&gt;if (SubStringCount(Value2,'|')=11,SubField(Value2,'|',9),if(SubStringCount(Value2,'|')=13,SubField(Value2,'|',11),'')) as Country,&lt;/P&gt;&lt;P&gt;if (SubStringCount(Value2,'|')=11,SubField(Value2,'|',10),if(SubStringCount(Value2,'|')=13,SubField(Value2,'|',12),SubField(Value2,'|',9))) as PONumber,&lt;/P&gt;&lt;P&gt;if (SubStringCount(Value2,'|')=11,subfield(SubField(Value2,'|',12),'-',1),if(SubStringCount(Value2,'|')=13,subfield(SubField(Value2,'|',14),'-',1),subfield(SubField(Value2,'|',11),'-',2))) as JobNumber,&lt;/P&gt;&lt;P&gt;Value2;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Value,&lt;/P&gt;&lt;P&gt;SubField(Value,':',1) as PackageType,&lt;/P&gt;&lt;P&gt;replace(replace(replace(SubField(Value,':',2) ,'/','|'),'\','|'),'||||','|') as Value2&lt;/P&gt;&lt;P&gt;Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Value&lt;/P&gt;&lt;P&gt;Package Type: \\Link Name\Folder\Client Name\Job Number\Process\Step\Country\PO Number\Source\Job Number-PO Number.fileextension&lt;/P&gt;&lt;P&gt;Package Type: \\Link Name\Master Folder\Folder\Sub-Folder\Client Name\Job Number\Process\Step\Country\PO Number\Source\Job Number-PO Number.fileextension&lt;/P&gt;&lt;P&gt;Package Type: ////System/Tool/Tool/Data/Log Number/Log ID/Upload Type/PO Number/Timestamp/Text-Job Number-PO Number.fileextension&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 14:14:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Split-field-name-into-mulitple-fields-inconsistent-string-length/m-p/918036#M318269</guid>
      <dc:creator>sasiparupudi1</dc:creator>
      <dc:date>2015-07-28T14:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: Split field name into mulitple fields (inconsistent string length)</title>
      <link>https://community.qlik.com/t5/QlikView/Split-field-name-into-mulitple-fields-inconsistent-string-length/m-p/918037#M318270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much Avinash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Subfield worked perfectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Much appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 14:54:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Split-field-name-into-mulitple-fields-inconsistent-string-length/m-p/918037#M318270</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-28T14:54:50Z</dc:date>
    </item>
  </channel>
</rss>

