<?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 Primary Key Exception in Lookup in Qlik Compose</title>
    <link>https://community.qlik.com/t5/Qlik-Compose/Primary-Key-Exception-in-Lookup/m-p/1759510#M166</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have two tables orders and customers,&lt;/P&gt;&lt;P&gt;I am trying to add the orders table as the lookup for the Order_Id column in Customers&lt;/P&gt;&lt;P&gt;My condition is Cust_Id=Ord_Cust_ID&lt;/P&gt;&lt;P&gt;I am getting a Primary Key Violation Error while Running&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="primar.JPG" style="width: 855px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/43756i0A901591C2F4843F/image-size/large?v=v2&amp;amp;px=999" role="button" title="primar.JPG" alt="primar.JPG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mapping1.JPG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/43757iCBCA7489D9CB7553/image-size/large?v=v2&amp;amp;px=999" role="button" title="mapping1.JPG" alt="mapping1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Mar 2025 20:49:07 GMT</pubDate>
    <dc:creator>Ray0801</dc:creator>
    <dc:date>2025-03-14T20:49:07Z</dc:date>
    <item>
      <title>Primary Key Exception in Lookup</title>
      <link>https://community.qlik.com/t5/Qlik-Compose/Primary-Key-Exception-in-Lookup/m-p/1759510#M166</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have two tables orders and customers,&lt;/P&gt;&lt;P&gt;I am trying to add the orders table as the lookup for the Order_Id column in Customers&lt;/P&gt;&lt;P&gt;My condition is Cust_Id=Ord_Cust_ID&lt;/P&gt;&lt;P&gt;I am getting a Primary Key Violation Error while Running&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="primar.JPG" style="width: 855px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/43756i0A901591C2F4843F/image-size/large?v=v2&amp;amp;px=999" role="button" title="primar.JPG" alt="primar.JPG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mapping1.JPG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/43757iCBCA7489D9CB7553/image-size/large?v=v2&amp;amp;px=999" role="button" title="mapping1.JPG" alt="mapping1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 20:49:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Compose/Primary-Key-Exception-in-Lookup/m-p/1759510#M166</guid>
      <dc:creator>Ray0801</dc:creator>
      <dc:date>2025-03-14T20:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Primary Key Exception in Lookup</title>
      <link>https://community.qlik.com/t5/Qlik-Compose/Primary-Key-Exception-in-Lookup/m-p/1759949#M168</link>
      <description>&lt;P&gt;The customer table Key (Natural or business key) is customer_id.&amp;nbsp; &amp;nbsp;By performing a lookup to orders - Compose will generate a left join - thereby creating multiple records with the same customer_id value.&amp;nbsp; Which then triggers the PK validation check.&amp;nbsp; (Multiple records for the NK).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you explain a little further what you are trying to do here?&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you trying to get the last order_id for each customer or ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are trying to relate orders to customer - then the relationship should be defined on the order table (with customer as the parent).&amp;nbsp; &amp;nbsp;This screenshot may show creating the relationship in the wrong direction ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 15:56:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Compose/Primary-Key-Exception-in-Lookup/m-p/1759949#M168</guid>
      <dc:creator>TimGarrod</dc:creator>
      <dc:date>2020-11-09T15:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: Primary Key Exception in Lookup</title>
      <link>https://community.qlik.com/t5/Qlik-Compose/Primary-Key-Exception-in-Lookup/m-p/1796264#M296</link>
      <description>Hi Ray,&lt;BR /&gt;&lt;BR /&gt;You are getting this error as their is a one to many relation between Cust_Id and Ord_Cust_ID due to which cust_id which is the key in your table is getting repeated giving a primary key voilation detected.&lt;BR /&gt;&lt;BR /&gt;As per my knowledge lookup here is doing a left join .&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Nikhil</description>
      <pubDate>Thu, 01 Apr 2021 05:50:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Compose/Primary-Key-Exception-in-Lookup/m-p/1796264#M296</guid>
      <dc:creator>nikhilraorane65</dc:creator>
      <dc:date>2021-04-01T05:50:23Z</dc:date>
    </item>
  </channel>
</rss>

