<?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 create composite key based on values from 2 tables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/create-composite-key-based-on-values-from-2-tables/m-p/1509681#M599681</link>
    <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;i've been searching the community for a couple of days, seems like i cant figure out how to solve this one.&lt;/P&gt;&lt;P&gt;i have 7 tables&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Main table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;DataDetails:&lt;BR /&gt;LOAD Id,&lt;BR /&gt;&lt;SPAN&gt;[Delivery Postal Code],&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;[Forwarder Track],&lt;/P&gt;&lt;P&gt;left join&lt;BR /&gt;LOAD [Delivery Postal Code],&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;Zone&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;To define the weight clas&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;GewichtKlassen:&lt;BR /&gt;LOAD Min,&lt;BR /&gt;Max,&lt;BR /&gt;&lt;FONT color="#008000"&gt;Gewicht_Klasse&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;inner join IntervalMatch (LAN_Weight)&lt;/P&gt;&lt;P&gt;load Min,&lt;BR /&gt;Max&lt;BR /&gt;Resident&lt;BR /&gt;GewichtKlassen;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Rates based in Zone and weight&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Landmark_Prices:&lt;BR /&gt;LOAD &lt;FONT color="#0000FF"&gt;Price_ID,&lt;/FONT&gt;&lt;BR /&gt;Price as LA_Price&lt;/P&gt;&lt;P&gt;now I would like to make a key in the table Data details something like&lt;/P&gt;&lt;P&gt;trim (&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;Zone&lt;/FONT&gt;&amp;amp;'-'&amp;amp;&lt;FONT color="#339966"&gt;Gewicht_Klasse&lt;/FONT&gt;) as &lt;FONT color="#0000FF"&gt;Price_ID&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;then i would be able to link the table DataDetails with Landmark_Prices&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;but when doing this i get an error that "Gewicht_Klasse" cannot be found (probably because its in another table?)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Nov 2018 12:22:46 GMT</pubDate>
    <dc:creator>PeterHenskens</dc:creator>
    <dc:date>2018-11-20T12:22:46Z</dc:date>
    <item>
      <title>create composite key based on values from 2 tables</title>
      <link>https://community.qlik.com/t5/QlikView/create-composite-key-based-on-values-from-2-tables/m-p/1509681#M599681</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;i've been searching the community for a couple of days, seems like i cant figure out how to solve this one.&lt;/P&gt;&lt;P&gt;i have 7 tables&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Main table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;DataDetails:&lt;BR /&gt;LOAD Id,&lt;BR /&gt;&lt;SPAN&gt;[Delivery Postal Code],&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;[Forwarder Track],&lt;/P&gt;&lt;P&gt;left join&lt;BR /&gt;LOAD [Delivery Postal Code],&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;Zone&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;To define the weight clas&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;GewichtKlassen:&lt;BR /&gt;LOAD Min,&lt;BR /&gt;Max,&lt;BR /&gt;&lt;FONT color="#008000"&gt;Gewicht_Klasse&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;inner join IntervalMatch (LAN_Weight)&lt;/P&gt;&lt;P&gt;load Min,&lt;BR /&gt;Max&lt;BR /&gt;Resident&lt;BR /&gt;GewichtKlassen;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Rates based in Zone and weight&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Landmark_Prices:&lt;BR /&gt;LOAD &lt;FONT color="#0000FF"&gt;Price_ID,&lt;/FONT&gt;&lt;BR /&gt;Price as LA_Price&lt;/P&gt;&lt;P&gt;now I would like to make a key in the table Data details something like&lt;/P&gt;&lt;P&gt;trim (&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;Zone&lt;/FONT&gt;&amp;amp;'-'&amp;amp;&lt;FONT color="#339966"&gt;Gewicht_Klasse&lt;/FONT&gt;) as &lt;FONT color="#0000FF"&gt;Price_ID&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;then i would be able to link the table DataDetails with Landmark_Prices&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;but when doing this i get an error that "Gewicht_Klasse" cannot be found (probably because its in another table?)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 12:22:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/create-composite-key-based-on-values-from-2-tables/m-p/1509681#M599681</guid>
      <dc:creator>PeterHenskens</dc:creator>
      <dc:date>2018-11-20T12:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: create composite key based on values from 2 tables</title>
      <link>https://community.qlik.com/t5/QlikView/create-composite-key-based-on-values-from-2-tables/m-p/1509709#M599682</link>
      <description>Yeah I don't think you can do that when they're not in the same table (how would it know which weight class belongs to which zone?).&lt;BR /&gt;&lt;BR /&gt;So you're going to have to get both fields to be in the same table. One option would be to join LAN_Weight to data details on customer ref (from the invoices table), the join the Gewicht_Klasse from the GewichtKlassen table. Then drop the customer ref field if you want.&lt;BR /&gt;&lt;BR /&gt;Might be a more efficient way to incorporate this into your existing script but it's hard to tell without seeing the full script.</description>
      <pubDate>Tue, 20 Nov 2018 12:58:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/create-composite-key-based-on-values-from-2-tables/m-p/1509709#M599682</guid>
      <dc:creator>jensmunnichs</dc:creator>
      <dc:date>2018-11-20T12:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: create composite key based on values from 2 tables</title>
      <link>https://community.qlik.com/t5/QlikView/create-composite-key-based-on-values-from-2-tables/m-p/1509726#M599683</link>
      <description>&lt;P&gt;Jens,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you for the responce.&lt;/P&gt;&lt;P&gt;i've tried to join "Gewicht_Klasse" into Landmark_Invoices.&lt;/P&gt;&lt;P&gt;but could not do this (probably just because i dont know how...)&amp;nbsp;&lt;/P&gt;&lt;P&gt;because "Gewicht_Klasse"&amp;nbsp; comes from an inner join intervalMatch from Gewichtklassen&lt;/P&gt;&lt;P&gt;do you know how to left join this into Landmark_Invoices?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Landmark_Invoices:&lt;/STRONG&gt;&lt;BR /&gt;LOAD [Customer Ref],&lt;BR /&gt;[Processed/Returned Date] as LAN_Invoice_Date,&lt;BR /&gt;[Weight (lb)] as LAN_Weight,&lt;BR /&gt;[Base Charge],&lt;BR /&gt;[Additional Charges],&lt;BR /&gt;[Total Charge]&lt;BR /&gt;FROM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;GewichtKlassen:&lt;/STRONG&gt;&lt;BR /&gt;LOAD Min,&lt;BR /&gt;Max,&lt;BR /&gt;Gewicht_Klasse&lt;BR /&gt;FROM&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;// i've tried (Red)&amp;nbsp; but failed...&lt;/U&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;left join&lt;/FONT&gt;&lt;BR /&gt;inner join IntervalMatch (LAN_Weight)&lt;/P&gt;&lt;P&gt;load Min,&lt;BR /&gt;Max&lt;BR /&gt;Resident&lt;BR /&gt;GewichtKlassen;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 13:20:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/create-composite-key-based-on-values-from-2-tables/m-p/1509726#M599683</guid>
      <dc:creator>PeterHenskens</dc:creator>
      <dc:date>2018-11-20T13:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: create composite key based on values from 2 tables</title>
      <link>https://community.qlik.com/t5/QlikView/create-composite-key-based-on-values-from-2-tables/m-p/1509736#M599684</link>
      <description>Again this might not be the most efficient solution, but I would just go with the script you posted in your OP, then add:&lt;BR /&gt;&lt;BR /&gt;Left join (DataDetails)&lt;BR /&gt;LOAD [Customer Ref], LAN_Weight&lt;BR /&gt;Resident Landmark_Invoices;&lt;BR /&gt;&lt;BR /&gt;Left join (DataDetails)&lt;BR /&gt;LOAD LAN_Weight, Gewicht_Klasse&lt;BR /&gt;Resident GewichtKlassen;&lt;BR /&gt;&lt;BR /&gt;Drop field LAN_Weight from DataDetails;&lt;BR /&gt;&lt;BR /&gt;Left join (DataDetails)&lt;BR /&gt;LOAD [Forwarder Ref], trim (Zone&amp;amp;'-'&amp;amp;Gewicht_Klasse) as Price_ID&lt;BR /&gt;Resident DataDetails;&lt;BR /&gt;&lt;BR /&gt;I think that should work, if not let me know.</description>
      <pubDate>Tue, 20 Nov 2018 13:30:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/create-composite-key-based-on-values-from-2-tables/m-p/1509736#M599684</guid>
      <dc:creator>jensmunnichs</dc:creator>
      <dc:date>2018-11-20T13:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: create composite key based on values from 2 tables</title>
      <link>https://community.qlik.com/t5/QlikView/create-composite-key-based-on-values-from-2-tables/m-p/1509779#M599685</link>
      <description>&lt;P&gt;hey, brilliant !&lt;/P&gt;&lt;P&gt;this works perfecty.&lt;/P&gt;&lt;P&gt;i just needed to add 1 row under the last join:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;drop field Gewicht_Klasse from GewichtKlassen;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Else i would have created a circle, but with this line included it works perfrctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 14:12:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/create-composite-key-based-on-values-from-2-tables/m-p/1509779#M599685</guid>
      <dc:creator>PeterHenskens</dc:creator>
      <dc:date>2018-11-20T14:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: create composite key based on values from 2 tables</title>
      <link>https://community.qlik.com/t5/QlikView/create-composite-key-based-on-values-from-2-tables/m-p/1509785#M599687</link>
      <description>You are right, I forgot about that. Glad it's working &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;You could also drop Gewicht_Klasse from your DataDetails table after you've made your key, since then you'd be able to keep it in the GewichtKlassen table, which might make a little bit more sense than just having the brackets in that table but no weight classes.</description>
      <pubDate>Tue, 20 Nov 2018 14:20:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/create-composite-key-based-on-values-from-2-tables/m-p/1509785#M599687</guid>
      <dc:creator>jensmunnichs</dc:creator>
      <dc:date>2018-11-20T14:20:45Z</dc:date>
    </item>
  </channel>
</rss>

