<?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 delimited column based on dynamic format, among non-delimited columns in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Parse-delimited-column-based-on-dynamic-format-among-non/m-p/1073135#M1672</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It does break that rule, and it is generally only the case with one exception type. With the exception of the missing field, the order is preserved. I'd have to dig into the thousands of transactions to verify, but I believe I may be able to amend the rule to something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The order is preserved except in the instance a serial number is missing. The first delimited attribute in column 1 will be "serial number" or similar, and the first delimited attribute in column 2 SHOULD be the serial number, however it may be missing. In this case, something along the lines of the below may work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF(number or pipes in column 1 &amp;gt; number of pipes in column 2, first attribute in column 1 = null) then continue to match the other attributes together&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does that help? I will look into SubField().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Apr 2016 23:06:18 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-04-20T23:06:18Z</dc:date>
    <item>
      <title>Parse delimited column based on dynamic format, among non-delimited columns</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Parse-delimited-column-based-on-dynamic-format-among-non/m-p/1073132#M1669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My first question here was answered in short order, I'm hoping for the same here! This one is (I think) a little more complex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a tool-generated .xls file that contains many columns. Two of these columns are multipurpose (which sucks). Essentially I need to parse these two columns on load and associate them with one-another in some fashion. I've attached a sample, but bear with me here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The columns are pipe-delimited, with a space on each end of the pipe. Ex: "xyz | abc | 123"&lt;/LI&gt;&lt;LI&gt;The number of delimited attributes is dynamic. Ex: "xyz | 123" vs. the next row "123 | abc | jkl"&lt;/LI&gt;&lt;LI&gt;The order of the delimited attributes is dynamic, with respect to other rows, but will always match the same row's other column. That is to say the order of delimited column 1 on row 23 will always match the order of delimited column 2 on row 23, but not necessarily on row 24 (with one exception, see number 6).&lt;/LI&gt;&lt;LI&gt;The first delimited column contains the names of the attributes delimited in the second column. Ex: column 1 = "type | product | amount" and column 2 = "type abc | product xyz | 123"&lt;/LI&gt;&lt;LI&gt;Sometimes there are no delimiters, as there is only one value in each column.&lt;/LI&gt;&lt;LI&gt;The columns may not have the same number of delimited attributes. Ex: column 1 = "serial | product | amount" and column 2 = "product xyz | 7"&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;The ideal solution is one that parses the two columns into a number of new columns, let's say a maximum of 6 for each delimited column, named Custom Attribute 1 through 6, then Custom Value 1 through 6 with the corresponding values populating each new column on the row. Ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Delimited 1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Delimited 2&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Custom Attribute 1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Custom Attribute 2&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Custom Value 1&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Custom Value 2&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;product | serial&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;abc | 1234-asdf&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;product&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;serial&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;abc&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1234-asdf&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now if there is a better way to associate these parsed values to the rest of the table, please do pose some ideas. The real want is to be able to report on this in such a way that I can pick a row ID and say what the values are for the parsed columns, and run various metrics on the information therein, via counts, sums, etc. In a delimited column, it's somewhat useless.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would also be ok using these delimited columns to create new tables that correspond to an associated transaction ID (in the attached, consider Random Column A or B as a unique key).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 22:26:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Parse-delimited-column-based-on-dynamic-format-among-non/m-p/1073132#M1669</guid>
      <dc:creator />
      <dc:date>2016-04-20T22:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Parse delimited column based on dynamic format, among non-delimited columns</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Parse-delimited-column-based-on-dynamic-format-among-non/m-p/1073133#M1670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can look into SubField() to separate the values and create new records, but one thing may be problematic:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;EM&gt;The columns may not have the same number of delimited attributes. Ex: column 1 = "serial | product | amount" and column 2 = "product xyz | 7"&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This example seems to show a missing serial in column2. Is this correct? Wouldn't this break the other rule, that the order is preserved?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 22:57:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Parse-delimited-column-based-on-dynamic-format-among-non/m-p/1073133#M1670</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-04-20T22:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Parse delimited column based on dynamic format, among non-delimited columns</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Parse-delimited-column-based-on-dynamic-format-among-non/m-p/1073134#M1671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe try this for a start:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14611934953035304" jivemacro_uid="_14611934953035304"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;INPUT:&lt;/P&gt;
&lt;P&gt;LOAD [Random Column A],&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Delimited Field 1],&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Delimited Field 2],&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Random Column B],&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; recno() as RecID&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;[Exceptions Transactions - Example.xls]&lt;/P&gt;
&lt;P&gt;(biff, embedded labels, table is Data$);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LOAD RecID,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Subfield( [Delimited Field 1],'|',IterNo() ) as DelField1,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Subfield( [Delimited Field 2],'|',IterNo() ) as DelField2,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; IterNo() as DelIndex&lt;/P&gt;
&lt;P&gt;Resident INPUT&lt;/P&gt;
&lt;P&gt;While iterno() &amp;lt;= RangeMax(SubStringCount([Delimited Field 1],'|'),SubStringCount([Delimited Field 2],'|'))+1; &lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 23:05:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Parse-delimited-column-based-on-dynamic-format-among-non/m-p/1073134#M1671</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-04-20T23:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Parse delimited column based on dynamic format, among non-delimited columns</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Parse-delimited-column-based-on-dynamic-format-among-non/m-p/1073135#M1672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It does break that rule, and it is generally only the case with one exception type. With the exception of the missing field, the order is preserved. I'd have to dig into the thousands of transactions to verify, but I believe I may be able to amend the rule to something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The order is preserved except in the instance a serial number is missing. The first delimited attribute in column 1 will be "serial number" or similar, and the first delimited attribute in column 2 SHOULD be the serial number, however it may be missing. In this case, something along the lines of the below may work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF(number or pipes in column 1 &amp;gt; number of pipes in column 2, first attribute in column 1 = null) then continue to match the other attributes together&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does that help? I will look into SubField().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 23:06:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Parse-delimited-column-based-on-dynamic-format-among-non/m-p/1073135#M1672</guid>
      <dc:creator />
      <dc:date>2016-04-20T23:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Parse delimited column based on dynamic format, among non-delimited columns</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Parse-delimited-column-based-on-dynamic-format-among-non/m-p/1073136#M1673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This looks like a good start. I will try this out and report back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Russ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 23:08:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Parse-delimited-column-based-on-dynamic-format-among-non/m-p/1073136#M1673</guid>
      <dc:creator />
      <dc:date>2016-04-20T23:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Parse delimited column based on dynamic format, among non-delimited columns</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Parse-delimited-column-based-on-dynamic-format-among-non/m-p/1073137#M1674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code is not checking for the explicite values, just aligning the available column2 values starting from the end.&lt;/P&gt;&lt;P&gt;For your sample data, this seems to be sufficient:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;INPUT:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD [Random Column A], &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Delimited Field 1], &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Delimited Field 2], &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Random Column B], &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; recno() as RecID&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;[Exceptions Transactions - Example.xls]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(biff, embedded labels, table is Data$);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD RecID,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Subfield( [Delimited Field 1],'|',IterNo() ) as DelField1,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Subfield( [Delimited Field 2],'|',&lt;STRONG&gt;IterNo()-(SubStringCount([Delimited Field 1],'|')-SubStringCount([Delimited Field 2],'|') )) as DelField2,&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; IterNo() as DelIndex&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident INPUT&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;While iterno() &amp;lt;= RangeMax(SubStringCount([Delimited Field 1],'|'),SubStringCount([Delimited Field 2],'|'))+1;&amp;nbsp; &lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2016 14:11:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Parse-delimited-column-based-on-dynamic-format-among-non/m-p/1073137#M1674</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-04-21T14:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Parse delimited column based on dynamic format, among non-delimited columns</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Parse-delimited-column-based-on-dynamic-format-among-non/m-p/1073138#M1675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again for your help - you're seriously good at this stuff.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should work quite well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Russ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2016 18:53:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Parse-delimited-column-based-on-dynamic-format-among-non/m-p/1073138#M1675</guid>
      <dc:creator />
      <dc:date>2016-04-21T18:53:30Z</dc:date>
    </item>
  </channel>
</rss>

