<?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: Cross referencing in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Cross-referencing-in-script/m-p/616661#M682806</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use a mapping table and the applymap function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13929744686978493" jivemacro_uid="_13929744686978493"&gt;
&lt;P&gt;MapRegion:&lt;/P&gt;
&lt;P&gt;mapping LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID, REGION,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, Europe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, Asia&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;LOAD ID, COUNTRY, applymap('MapRegion',PARENTID,REGION) as REGION, PARENTID INLINE [&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID, COUNTRY, REGION, PARENTID&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, Sweden, Europe,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, Norway, , 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, China, Asia&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;



&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See attached qvw.&lt;/P&gt;&lt;P&gt;Note, the inline loads are just examples. You can create the tables from loads from files or databases just as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Feb 2014 09:13:34 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2014-02-21T09:13:34Z</dc:date>
    <item>
      <title>Cross referencing in script</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-referencing-in-script/m-p/616660#M682805</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;I'm sure that I'm creating a post that there already is an answer for but I can not find it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table that looks like the one below. What i want to do in the script is to look at the parent ID field. If there is a value I want it to find that row based on the ID field, copy the region value and put it in the region field for the row that has a parent ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, in this example I want Norway to inherit the region value Europe from its parent Sweden.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;COUNTRY&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;REGION&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;PARENTID&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Sweden&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Europe&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Norway&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;China&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Asia&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be much appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Feb 2014 08:43:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-referencing-in-script/m-p/616660#M682805</guid>
      <dc:creator />
      <dc:date>2014-02-21T08:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Cross referencing in script</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-referencing-in-script/m-p/616661#M682806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use a mapping table and the applymap function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13929744686978493" jivemacro_uid="_13929744686978493"&gt;
&lt;P&gt;MapRegion:&lt;/P&gt;
&lt;P&gt;mapping LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID, REGION,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, Europe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, Asia&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;LOAD ID, COUNTRY, applymap('MapRegion',PARENTID,REGION) as REGION, PARENTID INLINE [&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID, COUNTRY, REGION, PARENTID&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, Sweden, Europe,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, Norway, , 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, China, Asia&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;



&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See attached qvw.&lt;/P&gt;&lt;P&gt;Note, the inline loads are just examples. You can create the tables from loads from files or databases just as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Feb 2014 09:13:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-referencing-in-script/m-p/616661#M682806</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-02-21T09:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: Cross referencing in script</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-referencing-in-script/m-p/616662#M682807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Works great!&lt;/P&gt;&lt;P&gt;Thank you so much for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Feb 2014 11:00:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-referencing-in-script/m-p/616662#M682807</guid>
      <dc:creator />
      <dc:date>2014-02-21T11:00:46Z</dc:date>
    </item>
  </channel>
</rss>

