<?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: How to split string several time based on substring count. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-split-string-several-time-based-on-substring-count/m-p/477709#M1122075</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I check for it? I think there is line break.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Jan 2014 01:51:53 GMT</pubDate>
    <dc:creator>vvira1316</dc:creator>
    <dc:date>2014-01-08T01:51:53Z</dc:date>
    <item>
      <title>How to split string several time based on substring count.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-split-string-several-time-based-on-substring-count/m-p/477706#M1122072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a string column that has several approval statuses. I have used substringcount function to find out count of each substring that I want to locate. Based on count and length function now I want to split the string into multiple string for further processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm including the original string and providing substrings that I want to use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*** Begin of Original String ****&lt;/P&gt;&lt;P&gt;26-Jun-2013 10:00:24 – Ka Be&amp;nbsp; (Approval history) Group approval for ChangeQAReviewer approved by all users (QA Post Approval).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;20-Jun-2013 11:46:45 – Ar Ra (Approval history) Group approval for SUM-SAN-PCHA approved by user Ar Ra (Business Owner Post Approval).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;12-Jun-2013 15:44:16 - Ro Mi (Approval history) Group approval for ChangeQAReviewer approved by user Ro Mi (QA Post Approval).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;12-Jun-2013 15:41:56 - Ar Ra (Approval history) Group approval for SUM-SAN-PCHA approved by user Ar Ra (Business Owner Post Approval).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;12-Jun-2013 15:15:06 - Ro Mi (Approval history) Group approval for ChangeQAReviewer approved by user Ro Mi (QA Pre-Approval).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;12-Jun-2013 15:13:37 - Ar Ra (Approval history) Group approval for SUM-SAN-PCHA approved by user Ar Ra(Business Owner Pre-Approval).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;12-Jun-2013 15:12:34 - Ar Ra (Approval history) Group approval for SUM-SAN-ITRA approved by user Ar Ra (IT Review Approval).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;22-Mar-2013 12:44:37 - Ro Mi (Approval history) Group approval for SUM-SAN-QCHA approved by user Ro Mi (QA Pre-Approval).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;22-Mar-2013 12:09:18 - Arn Ra (Approval history) Group approval for SUM-SAN-PCHA approved by user Ar Ra (Business Owner Pre-Approval).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;22-Mar-2013 11:42:39 - Ar Ra (Approval history) Group approval for SUM-SAN-ITRA approved by user Ar Ra (IT Review Approval).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*** End of Original String ****&lt;/P&gt;&lt;P&gt;Different substrings based on which I want to split the strings are as follows&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="color: #1f497d;"&gt;(QA Post Approval).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="color: #1f497d;"&gt;(Business Owner Post Approval).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="color: #1f497d;"&gt;(QA Pre-Approval).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="color: #1f497d;"&gt;(Business Owner Pre-Approval).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="color: #1f497d;"&gt;(IT Review Approval).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;for example&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;one substring as &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;22-Mar-2013 11:42:39 - Ar Ra (Approval history) Group approval for SUM-SAN-ITRA approved by user Ar Ra (IT Review Approval).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;and&lt;/P&gt;&lt;P&gt;second substring as&lt;/P&gt;&lt;P&gt;12-Jun-2013 15:13:37 - Ar Ra (Approval history) Group approval for SUM-SAN-PCHA approved by user Ar Ra(Business Owner Pre-Approval).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so original string in the example has to be split into 10 different strings.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;I'm aware of index and mid functions that I can leverage here but I'm struggling with load and loop. Any suggestions will be very helpful.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Vijay&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 21:41:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-split-string-several-time-based-on-substring-count/m-p/477706#M1122072</guid>
      <dc:creator>vvira1316</dc:creator>
      <dc:date>2014-01-07T21:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to split string several time based on substring count.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-split-string-several-time-based-on-substring-count/m-p/477707#M1122073</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;i'm not in front of my computer to test the exact function, but I think you should try with Index(), mid(), and Subfield() functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope that helps you, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 22:45:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-split-string-several-time-based-on-substring-count/m-p/477707#M1122073</guid>
      <dc:creator>martin59</dc:creator>
      <dc:date>2014-01-07T22:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to split string several time based on substring count.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-split-string-several-time-based-on-substring-count/m-p/477708#M1122074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have line breaks (chr(10)) between each of those lines in the original string?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 22:57:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-split-string-several-time-based-on-substring-count/m-p/477708#M1122074</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2014-01-07T22:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to split string several time based on substring count.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-split-string-several-time-based-on-substring-count/m-p/477709#M1122075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I check for it? I think there is line break.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 01:51:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-split-string-several-time-based-on-substring-count/m-p/477709#M1122075</guid>
      <dc:creator>vvira1316</dc:creator>
      <dc:date>2014-01-08T01:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to split string several time based on substring count.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-split-string-several-time-based-on-substring-count/m-p/477710#M1122076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vijay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have three case in my mind. Let start:&lt;/P&gt;&lt;P&gt;1. Case1: &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;If the line break is "Enter Line" you may try &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;STRONG&gt;SubField([StringField],Chr(10))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2. Case2: O&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;ne string line with dot for each end string line, you may try &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;STRONG&gt;SubField([StringField],'.')&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;3. Case3: One string line no dot. See example below:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13891475685074932" jivemacro_uid="_13891475685074932"&gt;
&lt;P&gt;[Data]:&lt;/P&gt;
&lt;P&gt;LOAD * Inline [&lt;/P&gt;
&lt;P&gt;ID, STR&lt;/P&gt;
&lt;P&gt;1, '12-Jun-2013 15:12:34 - Arnaldo Ramos (Approval history) Group approval for SUM-SAN-ITRA approved by user Ar Ra (IT Review Approval) 22-Mar-2013 12:44:37 - Ro Mi (Approval history) Group approval for SUM-SAN-QCHA approved by user Ro Mi (QA Pre-Approval)'&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;[Data2]:&lt;/P&gt;
&lt;P&gt;LOAD *,Trim(tmpSTR) &amp;amp; 'Approval)' AS NewSTR Where Len(tmpSTR)&amp;gt;0;&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ID,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SubField(STR,'Approval)') AS tmpSTR&lt;/P&gt;
&lt;P&gt;Resident [Data];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP Field tmpSTR;&lt;/P&gt;
&lt;P&gt;DROP Table [Data]&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sokkorn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 02:20:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-split-string-several-time-based-on-substring-count/m-p/477710#M1122076</guid>
      <dc:creator>Sokkorn</dc:creator>
      <dc:date>2014-01-08T02:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to split string several time based on substring count.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-split-string-several-time-based-on-substring-count/m-p/477711#M1122077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This string is part of a row in data table. This functionality has to be done for all rows. Can you please edit your post and remove the name in the string before (Approval history) . Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 02:54:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-split-string-several-time-based-on-substring-count/m-p/477711#M1122077</guid>
      <dc:creator>vvira1316</dc:creator>
      <dc:date>2014-01-08T02:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to split string several time based on substring count.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-split-string-several-time-based-on-substring-count/m-p/477712#M1122078</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;I'm able to get positions of substring using Mid, Index, and For loop functions. I'm running into couple of issues once the process is complete.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first Issue is as follows.&lt;/P&gt;&lt;P&gt;I'm suppose to get 10 count information for positions. I'm getting 11 for some reason with 1 one repeating. I've attached the screenshot of output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="51313" alt="StringCount_ExtraLine.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/51313_StringCount_ExtraLine.JPG.jpg" style="width: 620px; height: 216px;" /&gt;&lt;/P&gt;&lt;P&gt;The second issue is as follows.&lt;/P&gt;&lt;P&gt;I had modified my script to use different logic then one in the issue one. Here I'm looking for pattern ').' in the string. I got the count and with some logic I'm finding the starting position from where I want to do substring using mid function and the length of substring I will like to have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In debug I'm getting following syntax but it is resulting in NULL value for variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: green; font-family: 'Courier New'; font-size: 9pt;"&gt;LET StringDesc = Mid(trim($(StringDesc)), $(BegPos), $(StringLen));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;LET&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;STRONG style="color: gray; font-size: 9pt; font-family: 'Courier New';"&gt;&lt;EM&gt;StringDesc&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;Mid&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;trim&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;"26-Jun-2013 10:00:24 - Ksjhj Bahjdh (Approval history) Group approval for ChangeQAReviewer approved by all users (QA Post Approval).&lt;BR /&gt;&lt;BR /&gt;20-Jun-2013 11:46:45 - Arkasoa Rnsls (Approval history) Group approval for SUM-SAN-PCHA approved by user Arkasoa Rnsls (Business Owner Post Approval).&lt;BR /&gt;&lt;BR /&gt;12-Jun-2013 15:44:16 - Redred Greenred (Approval history) Group approval for ChangeQAReviewer approved by user Redred Greenred (QA Post Approval).&lt;BR /&gt;&lt;BR /&gt;12-Jun-2013 15:41:56 - Arkasoa Rnsls (Approval history) Group approval for SUM-SAN-PCHA approved by user Arkasoa Rnsls (Business Owner Post Approval).&lt;BR /&gt;&lt;BR /&gt;12-Jun-2013 15:15:06 - Redred Greenred (Approval history) Group approval for ChangeQAReviewer approved by user Redred Greenred (QA Pre-Approval).&lt;BR /&gt;&lt;BR /&gt;12-Jun-2013 15:13:37 - Arkasoa Rnsls (Approval history) Group approval for SUM-SAN-PCHA approved by user Arkasoa Rnsls (Business Owner Pre-Approval).&lt;BR /&gt;&lt;BR /&gt;12-Jun-2013 15:12:34 - Arkasoa Rnsls (Approval history) Group approval for SUM-SAN-ITRA approved by user Arkasoa Rnsls (IT Review Approval).&lt;BR /&gt;&lt;BR /&gt;22-Mar-2013 12:44:37 - Redred Greenred (Approval history) Group approval for SUM-SAN-QCHA approved by user Redred Greenred (QA Pre-Approval).&lt;BR /&gt;&lt;BR /&gt;22-Mar-2013 12:09:18 - Arkasoa Rnsls (Approval history) Group approval for SUM-SAN-PCHA approved by user Arkasoa Rnsls (Business Owner Pre-Approval).&lt;BR /&gt;&lt;BR /&gt;22-Mar-2013 11:42:39 - Arkasoa Rnsls (Approval history) Group approval for SUM-SAN-ITRA approved by user Arkasoa Rnsls (IT Review Approval)."&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;), 1, 132) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;I'll appreciate some guidance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;Vijay&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 16:51:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-split-string-several-time-based-on-substring-count/m-p/477712#M1122078</guid>
      <dc:creator>vvira1316</dc:creator>
      <dc:date>2014-01-09T16:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to split string several time based on substring count.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-split-string-several-time-based-on-substring-count/m-p/477713#M1122079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've figured out how to split the string. I had to use CHR(39) to remove the second error. Now I'm struggling with conditional insertion of records and appending the tablewhile processing the For Loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 23:09:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-split-string-several-time-based-on-substring-count/m-p/477713#M1122079</guid>
      <dc:creator>vvira1316</dc:creator>
      <dc:date>2014-01-09T23:09:33Z</dc:date>
    </item>
  </channel>
</rss>

