<?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 Dynamic key while joining tables? or any other solution? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dynamic-key-while-joining-tables-or-any-other-solution/m-p/1442605#M808964</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a fact table - F_PLANT&lt;/P&gt;&lt;P&gt;I have dimension to derive the information - D_PLANT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately the plant dimensions have new IDs whereas the fact is updated with Old IDs only. hence there is a new table created for IDs - X_PLANT_UPDATED - which has following columns&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OLD_ID,&lt;/P&gt;&lt;P&gt;NEW_ID,&lt;/P&gt;&lt;P&gt;VALID_FROM,&lt;/P&gt;&lt;P&gt;VALID_UPTO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i have to derive information from dimension(with new ids) into fact(with old ids) using the table X_PLANT_UPDATED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Supriya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>supriyabiware</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Dynamic key while joining tables? or any other solution?</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-key-while-joining-tables-or-any-other-solution/m-p/1442605#M808964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a fact table - F_PLANT&lt;/P&gt;&lt;P&gt;I have dimension to derive the information - D_PLANT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately the plant dimensions have new IDs whereas the fact is updated with Old IDs only. hence there is a new table created for IDs - X_PLANT_UPDATED - which has following columns&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OLD_ID,&lt;/P&gt;&lt;P&gt;NEW_ID,&lt;/P&gt;&lt;P&gt;VALID_FROM,&lt;/P&gt;&lt;P&gt;VALID_UPTO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i have to derive information from dimension(with new ids) into fact(with old ids) using the table X_PLANT_UPDATED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Supriya.&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/Dynamic-key-while-joining-tables-or-any-other-solution/m-p/1442605#M808964</guid>
      <dc:creator>supriyabiware</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic key while joining tables? or any other solution?</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-key-while-joining-tables-or-any-other-solution/m-p/1442606#M808965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is best handled using interval match ("extended syntax"):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;// Load the interval table&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Update:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD OLD_ID,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; NEW_ID,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; VALID_FROM,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; VALID_UPTO&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM X_PLANT_UPDATED;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;// Load the fact table. Alias the ID to OLD_ID&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;F_PLANT:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD ID as OLD_ID,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; DATE&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; ...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM F_PLANT;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;// Match the updates using IntervalMatch&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Left Join (F_PLANT)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;IntervalMatch(DATE, OLD_ID)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD VALID_FROM,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; VALID_UPTO,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; OLD_ID&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident Update;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;// Fetch the new ID and alias it to ID&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Left Join (F_PLANT)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD OLD_ID,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; NEW_ID as ID,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; VALID_FROM,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; VALID_UPTO&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident Update;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;// Clean up&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DROP Table Update;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DROP Fields VALID_FROM, VALID_UPTO;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;// Now load the dimension&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;D_PLANT:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD ID&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; ...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM D_PLANT;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This assumes that the ID field is called "ID" date field is called "DATE". Modify the script above with the correct field names if necessary.&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2017 09:40:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-key-while-joining-tables-or-any-other-solution/m-p/1442606#M808965</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2017-10-12T09:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic key while joining tables? or any other solution?</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-key-while-joining-tables-or-any-other-solution/m-p/1442607#M808966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thankyou for your reply Jonathan,&lt;/P&gt;&lt;P&gt;As i understand , in this case we are replacing the Old IDs with New IDs matching the valid from and upto from update table , but my old ids need to stay in the table(in the ID column) since ID is joined to other facts or dimensions accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way wherein i can have both columns OLD ID and NEW ID in the fact and join the dimension using a logic?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*valid from and upto not much imp.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2017 12:10:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-key-while-joining-tables-or-any-other-solution/m-p/1442607#M808966</guid>
      <dc:creator>supriyabiware</dc:creator>
      <dc:date>2017-10-12T12:10:13Z</dc:date>
    </item>
  </channel>
</rss>

