<?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: ApplyMap() on a newly created Field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/ApplyMap-on-a-newly-created-Field/m-p/1634815#M732729</link>
    <description>&lt;P&gt;map both steps in one line&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ApplyMap('Mapping_Clr_AS_Gruppe' , ApplyMap('Mapping_Ausschusscodes' , AS_Code , 'Fehler') , RGB(90,91,90))
AS       Clr_AS_Gruppe&lt;/LI-CODE&gt;&lt;P&gt;regards&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Oct 2019 12:06:25 GMT</pubDate>
    <dc:creator>martinpohl</dc:creator>
    <dc:date>2019-10-14T12:06:25Z</dc:date>
    <item>
      <title>ApplyMap() on a newly created Field</title>
      <link>https://community.qlik.com/t5/QlikView/ApplyMap-on-a-newly-created-Field/m-p/1634810#M732728</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I'm facing a problem with the ApplyMap() script-function.&lt;/P&gt;&lt;P&gt;I'm using an Inline table to map groups to different codes like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Mapping_Ausschusscodes:

Mapping LOAD * INLINE [
AS_CODE , Auschussgruppe
Code1 , Gruppe1
Code2 , Gruppe1
Code3 , Gruppe2
Code4 , Gruppe2
Code5 , Gruppe1
]
;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;In my facttable it looks like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Ausschuss:
LOAD * AS_CODE 
AS     Ausschusscode,
       ApplyMap('Mapping_Ausschusscodes' , AS_Code , 'Fehler') 
AS     Ausschussgruppe
       ...
FROM   Ausschuss.qvd (qvd)
;&lt;/LI-CODE&gt;&lt;P&gt;In addition to that I want to map colours to the different Groups so I built a table like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Farbcodes_Ausschussgruppen_tmp:
LOAD * INLINE [
       Ausschussgruppe , Red , Green , Blue
       Gruppe1         , 0   , 80    , 140
       Gruppe2         , 255 , 255   , 0
]
;

Mapping_Clr_AS_Gruppe:
MAPPING LOAD Ausschussgruppe,
             RGB(Red,Green,Blue)
AS           Clr_AS_Gruppe
RESIDENT     Farbcodes_Ausschussgruppen_tmp
;

Drop table   Farbcodes_Ausschussgruppen_tmp
;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the ende the code in the facttable looks like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Ausschuss:
LOAD * AS_CODE as Ausschusscode,
       ApplyMap('Mapping_Ausschusscodes' , AS_Code , 'Fehler') 
AS     Ausschussgruppe
//     ...
FROM   Ausschuss.qvd (qvd)
;
/*I made an extra table for the colourcoding because I could not apply the map on the newly created field 'Ausschussgruppe'*/

Farbcodierung:
LOAD     Ausschussgruppe,
         ApplyMap('Mapping_Clr_AS_Gruppe' , Ausschussgruppe , RGB(90,91,90))
AS       Clr_AS_Gruppe
RESIDENT Ausschuss
;&lt;/LI-CODE&gt;&lt;P&gt;Now QlikView creates a synthetic Key, I think because of the double use of 'Ausschussgruppe'. Is there a way to apply the colourmap to the newly created field without creating a synthetic key/table?&lt;/P&gt;&lt;P&gt;&amp;nbsp;Or is there a way to integrate the RGB-Codes into the first mappingtable?&lt;/P&gt;&lt;P&gt;Thanks in advance! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;AR&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ApplyMap-on-a-newly-created-Field/m-p/1634810#M732728</guid>
      <dc:creator>andreas_ar</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: ApplyMap() on a newly created Field</title>
      <link>https://community.qlik.com/t5/QlikView/ApplyMap-on-a-newly-created-Field/m-p/1634815#M732729</link>
      <description>&lt;P&gt;map both steps in one line&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ApplyMap('Mapping_Clr_AS_Gruppe' , ApplyMap('Mapping_Ausschusscodes' , AS_Code , 'Fehler') , RGB(90,91,90))
AS       Clr_AS_Gruppe&lt;/LI-CODE&gt;&lt;P&gt;regards&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 12:06:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ApplyMap-on-a-newly-created-Field/m-p/1634815#M732729</guid>
      <dc:creator>martinpohl</dc:creator>
      <dc:date>2019-10-14T12:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: ApplyMap() on a newly created Field</title>
      <link>https://community.qlik.com/t5/QlikView/ApplyMap-on-a-newly-created-Field/m-p/1634827#M732730</link>
      <description>&lt;P&gt;Thanks for your quick answer. It works. Didn't know that ApplyMap can be nested. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 12:17:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ApplyMap-on-a-newly-created-Field/m-p/1634827#M732730</guid>
      <dc:creator>andreas_ar</dc:creator>
      <dc:date>2019-10-14T12:17:41Z</dc:date>
    </item>
  </channel>
</rss>

