<?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: Using Apply Map only for values that exist in Mapping Table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-Apply-Map-only-for-values-that-exist-in-Mapping-Table/m-p/2003426#M1221462</link>
    <description>&lt;LI-CODE lang="markup"&gt;Field1Map:
Mapping LOAD ID, 
             new_field1
FROM
[https://community.qlik.com/t5/QlikView-App-Dev/Using-Apply-Map-only-for-values-that-exist-in-Mapping-Table/td-p/2002578]
(html, utf8, UserAgent is 'Mozilla/5.0', embedded labels, table is @2);

Field2Map:
Mapping LOAD ID, 
             new_field2
FROM
[https://community.qlik.com/t5/QlikView-App-Dev/Using-Apply-Map-only-for-values-that-exist-in-Mapping-Table/td-p/2002578]
(html, utf8, UserAgent is 'Mozilla/5.0', embedded labels, table is @2);


new_main_table:
LOAD ID, 
     some_other_important_fields,
     ApplyMap('Field1Map',ID,field1) as Field1,
     ApplyMap('Field2Map',ID,filed2) as Field2

FROM
[https://community.qlik.com/t5/QlikView-App-Dev/Using-Apply-Map-only-for-values-that-exist-in-Mapping-Table/td-p/2002578]
(html, utf8, UserAgent is 'Mozilla/5.0', embedded labels, table is @1);&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BrunPierre_0-1668157378185.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/93492iEEF582F514593310/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BrunPierre_0-1668157378185.png" alt="BrunPierre_0-1668157378185.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Nov 2022 09:03:09 GMT</pubDate>
    <dc:creator>BrunPierre</dc:creator>
    <dc:date>2022-11-11T09:03:09Z</dc:date>
    <item>
      <title>Using Apply Map only for values that exist in Mapping Table</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Apply-Map-only-for-values-that-exist-in-Mapping-Table/m-p/2002578#M1221431</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I want to paste new values into the table, but only if they exist in the Mapping Table.&lt;/P&gt;
&lt;P&gt;The main table is:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="47px"&gt;ID&amp;nbsp;&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="47px"&gt;field1&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;filed2&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;some_other_important_fields&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;1&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;-&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="25px"&gt;-&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="25px"&gt;1234&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;2&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;asd&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="25px"&gt;fgh&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="25px"&gt;2356&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;3&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;-&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="25px"&gt;-&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="25px"&gt;7654&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="40px"&gt;4&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="40px"&gt;yxc&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="40px"&gt;
&lt;P&gt;vbn&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="40px"&gt;
&lt;P&gt;3456&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="40px"&gt;5&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="40px"&gt;-&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="40px"&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="40px"&gt;
&lt;P&gt;6789&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Than I want to paste some neu values from another table, that looks like:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;ID&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;new_field1&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;new_field2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;1&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;jkl&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;opü&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;3&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;qwe&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;rtz&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I use mapping:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Map:&lt;/P&gt;
&lt;P&gt;mapping load&lt;/P&gt;
&lt;P&gt;ID,&lt;/P&gt;
&lt;P&gt;new_field1&amp;amp;'|'&amp;amp;new_field2 as new_values&lt;/P&gt;
&lt;P&gt;resident table2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;new_main_table:&lt;/P&gt;
&lt;P&gt;Load&lt;/P&gt;
&lt;P&gt;ID,&lt;/P&gt;
&lt;P&gt;Subfield(ApplyMap('Map',ID),'|',1) as field1,&lt;/P&gt;
&lt;P&gt;Subfield(ApplyMap('Map',ID),'|',2) as field2,&lt;/P&gt;
&lt;P&gt;some_other_important_fields&lt;/P&gt;
&lt;P&gt;resident main_table;&lt;/P&gt;
&lt;P&gt;drop main table;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem is, that wenn I do so, the whole field1 and field 2 will overwrite. The desired result:&lt;/P&gt;
&lt;TABLE border="1" width="788px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="263px" height="47px"&gt;ID&amp;nbsp;&lt;/TD&gt;
&lt;TD width="263px" height="47px"&gt;field1&lt;/TD&gt;
&lt;TD width="131px" height="47px"&gt;filed2&lt;/TD&gt;
&lt;TD width="131px" height="47px"&gt;some_other_important_fields&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="263px" height="25px"&gt;1&lt;/TD&gt;
&lt;TD width="263px"&gt;jkl&lt;/TD&gt;
&lt;TD width="131px"&gt;opü&lt;/TD&gt;
&lt;TD width="131px" height="25px"&gt;1234&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="263px" height="25px"&gt;2&lt;/TD&gt;
&lt;TD width="263px" height="25px"&gt;asd&lt;/TD&gt;
&lt;TD width="131px" height="25px"&gt;fgh&lt;/TD&gt;
&lt;TD width="131px" height="25px"&gt;2356&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="263px" height="25px"&gt;3&lt;/TD&gt;
&lt;TD width="263px"&gt;qwe&lt;/TD&gt;
&lt;TD width="131px"&gt;rtz&lt;/TD&gt;
&lt;TD width="131px" height="25px"&gt;7654&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="263px" height="40px"&gt;4&lt;/TD&gt;
&lt;TD width="263px" height="40px"&gt;yxc&lt;/TD&gt;
&lt;TD width="131px" height="40px"&gt;
&lt;P&gt;vbn&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="131px" height="40px"&gt;
&lt;P&gt;3456&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="263px" height="40px"&gt;5&lt;/TD&gt;
&lt;TD width="263px" height="40px"&gt;-&lt;/TD&gt;
&lt;TD width="131px" height="40px"&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="131px" height="40px"&gt;
&lt;P&gt;6789&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Schoud I use some If condition? Or maybe there are some other ways, how I can paste this values into the table? Because my main table actualy have a loooot of columns and I do not really want to overwrite it. Only if it´s the only way.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Any help is greatly appreciated!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 16:46:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Apply-Map-only-for-values-that-exist-in-Mapping-Table/m-p/2002578#M1221431</guid>
      <dc:creator>olromanenko</dc:creator>
      <dc:date>2022-11-09T16:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using Apply Map only for values that exist in Mapping Table</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Apply-Map-only-for-values-that-exist-in-Mapping-Table/m-p/2003426#M1221462</link>
      <description>&lt;LI-CODE lang="markup"&gt;Field1Map:
Mapping LOAD ID, 
             new_field1
FROM
[https://community.qlik.com/t5/QlikView-App-Dev/Using-Apply-Map-only-for-values-that-exist-in-Mapping-Table/td-p/2002578]
(html, utf8, UserAgent is 'Mozilla/5.0', embedded labels, table is @2);

Field2Map:
Mapping LOAD ID, 
             new_field2
FROM
[https://community.qlik.com/t5/QlikView-App-Dev/Using-Apply-Map-only-for-values-that-exist-in-Mapping-Table/td-p/2002578]
(html, utf8, UserAgent is 'Mozilla/5.0', embedded labels, table is @2);


new_main_table:
LOAD ID, 
     some_other_important_fields,
     ApplyMap('Field1Map',ID,field1) as Field1,
     ApplyMap('Field2Map',ID,filed2) as Field2

FROM
[https://community.qlik.com/t5/QlikView-App-Dev/Using-Apply-Map-only-for-values-that-exist-in-Mapping-Table/td-p/2002578]
(html, utf8, UserAgent is 'Mozilla/5.0', embedded labels, table is @1);&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BrunPierre_0-1668157378185.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/93492iEEF582F514593310/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BrunPierre_0-1668157378185.png" alt="BrunPierre_0-1668157378185.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 09:03:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Apply-Map-only-for-values-that-exist-in-Mapping-Table/m-p/2003426#M1221462</guid>
      <dc:creator>BrunPierre</dc:creator>
      <dc:date>2022-11-11T09:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using Apply Map only for values that exist in Mapping Table</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Apply-Map-only-for-values-that-exist-in-Mapping-Table/m-p/2003496#M1221467</link>
      <description>&lt;P&gt;You need to query the exists of any respectively a certain content of the fields before you apply the applymap(). This may be done with multiple if-loops or depending on your data just with:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;coalesce(&lt;/STRONG&gt;field1,&amp;nbsp;&lt;SPAN&gt;Subfield(ApplyMap('Map',ID),'|',1)&lt;STRONG&gt;)&lt;/STRONG&gt; as field1,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 11:40:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Apply-Map-only-for-values-that-exist-in-Mapping-Table/m-p/2003496#M1221467</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-11-11T11:40:26Z</dc:date>
    </item>
  </channel>
</rss>

