<?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: Apply Map / If Wildmatch to find text within text string in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Apply-Map-If-Wildmatch-to-find-text-within-text-string/m-p/131242#M763788</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Brilliant, thank you very much for your help Sunny. It worked perfectly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Jul 2018 15:34:43 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-07-11T15:34:43Z</dc:date>
    <item>
      <title>Apply Map / If Wildmatch to find text within text string</title>
      <link>https://community.qlik.com/t5/QlikView/Apply-Map-If-Wildmatch-to-find-text-within-text-string/m-p/131240#M763786</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;What i am trying to do i thought would be easy, but I have stuck on this for a while. (i am an ameture user of Qlivkiew, so please remember this when answering).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 tables, one called Nationality Group which contains 2 fields, a "clean"/master list of Nationalities and a Nationality group to show if that nationality is in the EU, British or Non EU. My second table is the nationalities that have been entered against employees and therefore could contain extra text and a mix of upper and lower letters. (I accept that any spelling mistakes of Employee Nationalities won't get the Nationality group applied e.g Frenhc).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to apply the Nationality Group to the Employee Nationality and have used apply map to achieve this. The problem is i don't know how to get the Nationality group to apply to the Employee Nationality where there is the extra text. e.g find the word French within text string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The tables below only contains example data and in reality there are over 200+ master nationalities to check against 3000+ employees. I have seen on the forum people using if(wildmatch()) etc, but in all examples they specify the text to match rather than it coming from another table/applymap, so please help!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Nationality Group:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Load * Inline [&lt;/P&gt;&lt;P&gt;Nationality, Nationality Group&lt;/P&gt;&lt;P&gt;Albanian, Non EU&lt;/P&gt;&lt;P&gt;British, British&lt;/P&gt;&lt;P&gt;French, EU&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Employee Data:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Load * Inline [&lt;/P&gt;&lt;P&gt;Employee Number, Employee Nationality&lt;/P&gt;&lt;P&gt;1, 6/2/ 09 British&lt;/P&gt;&lt;P&gt;2, 21/05/ 17 british&lt;/P&gt;&lt;P&gt;3, Albanian&lt;/P&gt;&lt;P&gt;4, ALBANIAN (HR CHecked)&lt;/P&gt;&lt;P&gt;5, albanian, work visa, pasport, 13.03.09 14.04.11&lt;/P&gt;&lt;P&gt;6, British&lt;/P&gt;&lt;P&gt;7, French&lt;/P&gt;&lt;P&gt;8, 15/1/18 french (checked)&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Final output should look like below....&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Employee Data:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Load * Inline [&lt;/P&gt;&lt;P&gt;Employee Number, Employee Nationality, Nationality Group&lt;/P&gt;&lt;P&gt;1, 6/2/ 09 British, British&lt;/P&gt;&lt;P&gt;2, 21/05/ 17 british, British&lt;/P&gt;&lt;P&gt;3, British, British&lt;/P&gt;&lt;P&gt;4, Albanian, Non EU&lt;/P&gt;&lt;P&gt;5, ALBANIAN (HR CHecked), Non EU&lt;/P&gt;&lt;P&gt;6, albanian, work visa, pasport, 13.03.09 14.04.11, Non EU&lt;/P&gt;&lt;P&gt;7, French, EU&lt;/P&gt;&lt;P&gt;8, 15/1/18 french (checked), EU&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Apply-Map-If-Wildmatch-to-find-text-within-text-string/m-p/131240#M763786</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Apply Map / If Wildmatch to find text within text string</title>
      <link>https://community.qlik.com/t5/QlikView/Apply-Map-If-Wildmatch-to-find-text-within-text-string/m-p/131241#M763787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;[Nationality Group]:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;Mapping&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;LOAD Upper(Nationality),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt; '@' &amp;amp; [Nationality Group] &amp;amp; '~';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;LOAD * INLINE [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Nationality, Nationality Group&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Albanian, Non EU&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; British, British&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; French, EU&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;[Employee Data]:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;LOAD *,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt; TextBetween(MapSubString('Nationality Group', Upper([Employee Nationality])), '@', '~') as [Nationality Group];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;LOAD * INLINE [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Employee Number, Employee Nationality&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, 6/2/ 09 British&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, 21/05/ 17 british&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, Albanian&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4, ALBANIAN (HR CHecked)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5, "albanian, work visa, pasport, 13.03.09 14.04.11"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6, British&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7, French&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8, 15/1/18 french (checked)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;];&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/207590_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jul 2018 13:30:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Apply-Map-If-Wildmatch-to-find-text-within-text-string/m-p/131241#M763787</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-07-11T13:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Apply Map / If Wildmatch to find text within text string</title>
      <link>https://community.qlik.com/t5/QlikView/Apply-Map-If-Wildmatch-to-find-text-within-text-string/m-p/131242#M763788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Brilliant, thank you very much for your help Sunny. It worked perfectly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jul 2018 15:34:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Apply-Map-If-Wildmatch-to-find-text-within-text-string/m-p/131242#M763788</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-11T15:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Apply Map / If Wildmatch to find text within text string</title>
      <link>https://community.qlik.com/t5/QlikView/Apply-Map-If-Wildmatch-to-find-text-within-text-string/m-p/1793311#M1210900</link>
      <description>&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;This really helped me on a different case. However I have a minor catch. From the below table when i follow exactly your script, I get "Other_Beauty" as Business for both the campaign's. Is there any way that this applymap works as per the order of the keywords given. ie first it looks for Hair and then map those campaigns to "Beauty" instead of "Other_Beauty". Can you pl help&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Keyword:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Load * Inline [&lt;/P&gt;&lt;P&gt;Keyword, Business&lt;/P&gt;&lt;P&gt;Hair, Beauty&lt;/P&gt;&lt;P&gt;BEA, Other_Beauty&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Campaign Data:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Load * Inline [&lt;/P&gt;&lt;P&gt;Campaign_Name&lt;/P&gt;&lt;P&gt;1,&amp;nbsp;LV_BEA_HairDryers&lt;/P&gt;&lt;P&gt;2, CZ_BEA_HairDryers&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Below is the script I used.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;[Keyword]:&lt;/P&gt;&lt;P&gt;Mapping LOAD&lt;/P&gt;&lt;P&gt;([Keyword]),&lt;/P&gt;&lt;P&gt;'@' &amp;amp; [Business Units] &amp;amp; '~';&lt;/P&gt;&lt;P&gt;LOAD *,&lt;BR /&gt;[Words to Lookup for],&lt;BR /&gt;[Business Units]&lt;BR /&gt;FROM [lib://AttachedFiles/Keyword.xlsx]&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;[Campaign Data]:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;TextBetween(MapSubString('Keyword',([Campaign name])), '@', '~') as [Business Units];&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;[Campaign name],&lt;BR /&gt;FROM [lib://AttachedFiles/CampaignFile.xlsx]&lt;BR /&gt;Exit Script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 11:52:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Apply-Map-If-Wildmatch-to-find-text-within-text-string/m-p/1793311#M1210900</guid>
      <dc:creator>mahendrankr</dc:creator>
      <dc:date>2021-03-22T11:52:38Z</dc:date>
    </item>
  </channel>
</rss>

