<?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: Contains and Replace in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Contains-and-Replace/m-p/988733#M964273</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It might not be super scalable, but you could try something like TextBetween() with nested if statements in your preceeding load. It'd require everything to follow the format you listed though, specifically in that the text you want to extract falls between the "US_" and " - " characters. But it might be a starting point, anyways!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Column1,&lt;/P&gt;&lt;P&gt;If(WildMatch(Column2,'*US_*'),TextBetween(Column2,'US_',' - '),&lt;/P&gt;&lt;P&gt;if(WildMatch(Column2,'*Asia_*'),TextBetween(Column2,'Asia_',' - '),)) as [Team Name]&lt;/P&gt;&lt;P&gt;INLINE [&lt;/P&gt;&lt;P&gt;Column1, Column2&lt;/P&gt;&lt;P&gt;1,Summary: Ticket Group: Asia_123Team - on this date, xxx&lt;/P&gt;&lt;P&gt;2,Summary: Ticket Group: US_Team1 - on this date, xxx&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: In thinking more about this, I supposed you could do without the nested if statements that check for the country name. That seems kind of pointless I guess. If you know that there's only one _ character in the string and it always follows the country name, then you'd just do something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TextBetween(Column2, '_', ' - ')as [Team Name]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Oct 2015 20:09:41 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-10-02T20:09:41Z</dc:date>
    <item>
      <title>Contains and Replace</title>
      <link>https://community.qlik.com/t5/QlikView/Contains-and-Replace/m-p/988732#M964272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I've loaded my excel table and I need assistance with adding a contains and replace into my script.&amp;nbsp; For example I have a description column in my excel table that contains commentary.&amp;nbsp; I need to search for keywords from this column and replace it with a name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So..for example, my 'Description' column looks like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Summary: Ticket Group: US_Team1 - on this date, xxx&lt;/P&gt;&lt;P&gt;2) Summary: Ticket Group: Asia_123Team - on this date, xxx&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need my script to search this Description column where if 'US_' exists then I need this new field to display Team 1 or if 'Asia_' exists I need this new field to display 123Team.&amp;nbsp; It needs to extract keyword between US_ and - or Asia_ and -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this makes sense. Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Oct 2015 19:43:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Contains-and-Replace/m-p/988732#M964272</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-02T19:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Contains and Replace</title>
      <link>https://community.qlik.com/t5/QlikView/Contains-and-Replace/m-p/988733#M964273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It might not be super scalable, but you could try something like TextBetween() with nested if statements in your preceeding load. It'd require everything to follow the format you listed though, specifically in that the text you want to extract falls between the "US_" and " - " characters. But it might be a starting point, anyways!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Column1,&lt;/P&gt;&lt;P&gt;If(WildMatch(Column2,'*US_*'),TextBetween(Column2,'US_',' - '),&lt;/P&gt;&lt;P&gt;if(WildMatch(Column2,'*Asia_*'),TextBetween(Column2,'Asia_',' - '),)) as [Team Name]&lt;/P&gt;&lt;P&gt;INLINE [&lt;/P&gt;&lt;P&gt;Column1, Column2&lt;/P&gt;&lt;P&gt;1,Summary: Ticket Group: Asia_123Team - on this date, xxx&lt;/P&gt;&lt;P&gt;2,Summary: Ticket Group: US_Team1 - on this date, xxx&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: In thinking more about this, I supposed you could do without the nested if statements that check for the country name. That seems kind of pointless I guess. If you know that there's only one _ character in the string and it always follows the country name, then you'd just do something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TextBetween(Column2, '_', ' - ')as [Team Name]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Oct 2015 20:09:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Contains-and-Replace/m-p/988733#M964273</guid>
      <dc:creator />
      <dc:date>2015-10-02T20:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Contains and Replace</title>
      <link>https://community.qlik.com/t5/QlikView/Contains-and-Replace/m-p/988734#M964274</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;one solution could be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_185287_Pic1.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/100819_QlikCommunity_Thread_185287_Pic1.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_185287_Pic2.JPG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/100835_QlikCommunity_Thread_185287_Pic2.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14438243780685853 jive_text_macro" jivemacro_uid="_14438243780685853"&gt;
&lt;P&gt;tabDelimiters:&lt;/P&gt;
&lt;P&gt;LOAD * Inline [&lt;/P&gt;
&lt;P&gt;Delimiter&lt;/P&gt;
&lt;P&gt;Africa&lt;/P&gt;
&lt;P&gt;Americas&lt;/P&gt;
&lt;P&gt;Asia&lt;/P&gt;
&lt;P&gt;Australia&lt;/P&gt;
&lt;P&gt;Europe&lt;/P&gt;
&lt;P&gt;US&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;mapDelimiters:&lt;/P&gt;
&lt;P&gt;Mapping LOAD RecNo(),*&lt;/P&gt;
&lt;P&gt;Resident tabDelimiters;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;tabYourExcel:&lt;/P&gt;
&lt;P&gt;LOAD *&lt;/P&gt;
&lt;P&gt;Where Len(Team);&lt;/P&gt;
&lt;P&gt;LOAD RecNo() as ID,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TextBetween(Description,ApplyMap('mapDelimiters',IterNo())&amp;amp;'_',' ') as Team,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ApplyMap('mapDelimiters',IterNo()) as Delimiter,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;/P&gt;
&lt;P&gt;Inline [&lt;/P&gt;
&lt;P&gt;Description&lt;/P&gt;
&lt;P&gt;1) Summary: Ticket Group: US_Team1 - on this date, xxx&lt;/P&gt;
&lt;P&gt;2) Summary: Ticket Group: Asia_123Team - on this date, xxx&lt;/P&gt;
&lt;P&gt;3) Summary: Ticket Group: Africa_234Team - on this date, xxx&lt;/P&gt;
&lt;P&gt;4) Summary: Ticket Group: Americas_345Team - on this date, xxx&lt;/P&gt;
&lt;P&gt;5) Summary: Ticket Group: Europe_456Team - on this date, xxx&lt;/P&gt;
&lt;P&gt;6) Summary: Ticket Group: Australia_567Team - on this date, xxx&lt;/P&gt;
&lt;P&gt;]&lt;/P&gt;
&lt;P&gt;While IterNo()&amp;lt;=FieldValueCount('Delimiter');&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Oct 2015 22:21:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Contains-and-Replace/m-p/988734#M964274</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2015-10-02T22:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: Contains and Replace</title>
      <link>https://community.qlik.com/t5/QlikView/Contains-and-Replace/m-p/988735#M964275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TextBetween seemed to work. How do I add multiple TextBetweens? I've tried OR and it didn't work. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2015 15:52:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Contains-and-Replace/m-p/988735#M964275</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-05T15:52:19Z</dc:date>
    </item>
  </channel>
</rss>

