<?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 UnRelated fields or subfield in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/UnRelated-fields-or-subfield/m-p/670485#M1060940</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I am using sub -field to relate the data now I need to remove the unwanted or unrelated data.&lt;/P&gt;&lt;P&gt;I am attaching the app do let me know the suggestions&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Oct 2014 08:06:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-10-07T08:06:21Z</dc:date>
    <item>
      <title>UnRelated fields or subfield</title>
      <link>https://community.qlik.com/t5/QlikView/UnRelated-fields-or-subfield/m-p/670485#M1060940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I am using sub -field to relate the data now I need to remove the unwanted or unrelated data.&lt;/P&gt;&lt;P&gt;I am attaching the app do let me know the suggestions&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2014 08:06:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/UnRelated-fields-or-subfield/m-p/670485#M1060940</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-07T08:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: UnRelated fields or subfield</title>
      <link>https://community.qlik.com/t5/QlikView/UnRelated-fields-or-subfield/m-p/670486#M1060941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are getting some rogue joins from where you are splitting the country name out.&amp;nbsp; AND for example exists in a number of country names and is therefore joining erroneously.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would appear to me that you need to build a mapping table between PRFT_CTR_LVL_2_CD and BUYER_COUNTRY, eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Map_LVL2Country:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MAPPING LOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Code,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;INLINE [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code,Name&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PCG00903,US&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;... rest of mappings here ...&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then map this onto the data, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ApplyMap('Map_LVL2Country', PRFT_CTR_LVL_2_CD. 'UNKNOWN') as BUYER_COUNTRY,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It then looks like some Level 2 codes relate to more than one country, so you may need to map some codes at level 6 instead, you can do this by nesting applymaps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ApplyMap('Map_LVL2Country', PRFT_CTR_LVL_2_CD, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG&gt;ApplyMap('Map_LVL6Country', PRFT_CTR_LVL_6_CD, 'UNKNOWN'&lt;/STRONG&gt;) as BUYER_COUNTRY,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can then map things at different levels depending on the granularity of the two data sources.&amp;nbsp; It will be a bit manual to set up the lookup lists, but I'm not sure it will work any other way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My blog post on ApplyMap goes into this in quite some detail:&amp;nbsp; &lt;A href="http://bit.ly/kQcAZ5" title="http://bit.ly/kQcAZ5"&gt;http://bit.ly/kQcAZ5&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2014 10:56:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/UnRelated-fields-or-subfield/m-p/670486#M1060941</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2014-10-07T10:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: UnRelated fields or subfield</title>
      <link>https://community.qlik.com/t5/QlikView/UnRelated-fields-or-subfield/m-p/670487#M1060942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Same issue for all 3 cases in the QVW,&amp;nbsp; you are joining on word components of the country name that are shared amongst unrelated countries.&amp;nbsp; Best to filter out those words from join... 'of' , 'and' , 'republic'.&amp;nbsp; Probably also 'north','south' etc.... there could be many. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a quick and dirty way to filter a loaded table in this way. Longer lists of words should be compiled in lookup table and filtered out through a table join in the script or a mapping load per Steve's writeups above. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp; CountryName,&lt;/P&gt;&lt;P&gt;&amp;nbsp; subfield(purgechar(Upper(Name),','),' ') as CountryWord&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(ooxml, no labels, table is Sheet1)&lt;/P&gt;&lt;P&gt; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Countries:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; *&lt;/P&gt;&lt;P&gt;resident Temp&lt;/P&gt;&lt;P&gt;where &lt;/P&gt;&lt;P&gt;&amp;nbsp; CountryWord&amp;lt;&amp;gt;'AND' and&lt;/P&gt;&lt;P&gt;&amp;nbsp; CountryWord&amp;lt;&amp;gt;'OR' and&lt;/P&gt;&lt;P&gt;&amp;nbsp; CountryWord&amp;lt;&amp;gt;'REPUBLIC' and&lt;/P&gt;&lt;P&gt;&amp;nbsp; CountryWord&amp;lt;&amp;gt;'OF' and&lt;/P&gt;&lt;P&gt;&amp;nbsp; CountryWord&amp;lt;&amp;gt;'PEOPLES'&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------&lt;/P&gt;&lt;P&gt;Q/A from QVW:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Here if we select the BOSNIA and Herzegovin we should only get Bosia Sales&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;nbsp; since you are joining on word,&amp;nbsp; 'and'&amp;nbsp; will be used to join to other countries with 'and' in the name like 'Trinidad' and 'Tobago' etc...&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) if we select China we are getting Central Africa ,Republic of Congo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - the selection is actually 'China, Peoples Republic of' . and if you join on any one of these&amp;nbsp; words , then you are going to join on &lt;SPAN style="font-size: 10pt;"&gt; 'of' and 'Republic'&amp;nbsp; which will cause a hit on 'Central Africa Republic' and 'Republic of Congo'. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3)if we select Korea Republic we are getting Bank of America, Centarl African and Republic of Congo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;nbsp; the selection is actually 'Korea, Republic of'&amp;nbsp; ...same issue as #2&lt;/P&gt;&lt;P&gt;---------------------------------&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2014 15:00:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/UnRelated-fields-or-subfield/m-p/670487#M1060942</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2014-10-07T15:00:48Z</dc:date>
    </item>
  </channel>
</rss>

