<?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 Conditional Join in Qlik Sense in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Conditional-Join-in-Qlik-Sense/m-p/62170#M4103</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to join two QVD tables based on a field in a third table (since the primary key in the first table will not have a match in the third table for products that are refunded). The field in the third table contains order_type field which is the base for my conditional join. Is there a way to have a conditional join in the load script to make this possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tables:&lt;/P&gt;&lt;P&gt;1. order_products&lt;/P&gt;&lt;P&gt;2. order_product_inventory&lt;/P&gt;&lt;P&gt;3.&lt;SPAN style="font-size: 13.3333px;"&gt; orders&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below are the two conditions:&lt;/P&gt;&lt;P&gt;#1. if orders.order_type &amp;lt;&amp;gt; 'refund' join &lt;SPAN style="font-size: 13.3333px;"&gt;order_products.&lt;STRONG&gt;id&lt;/STRONG&gt; to &lt;/SPAN&gt;order_product_inventory.&lt;STRONG&gt;order_product_id &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;#2. if orders.order_type = 'refund' join &lt;SPAN style="font-size: 13.3333px;"&gt;order_products.&lt;/SPAN&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;refunded_order_product_id &lt;/STRONG&gt;to &lt;SPAN style="font-size: 13.3333px;"&gt;order_product_inventory.&lt;STRONG style="font-size: 13.3333px;"&gt;order_product_id&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you'd like to see the sql query for the two conditions, see below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#1 order_type &amp;lt;&amp;gt; 'refund'&lt;/P&gt;&lt;P&gt;Select *&lt;/P&gt;&lt;P&gt;FROM orders ord&lt;/P&gt;&lt;P&gt;LEFT JOIN order_products opr on ord.id = opr.order_id&lt;/P&gt;&lt;P&gt;LEFT JOIN order_product_inv opi on opr.id = opi.order_product_id&lt;/P&gt;&lt;P&gt;WHERE ord.order_type &amp;lt;&amp;gt; 'refund'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#2 order_type = 'refund'&lt;/P&gt;&lt;P&gt;Select * &lt;/P&gt;&lt;P&gt;FROM orders ord &lt;/P&gt;&lt;P&gt;LEFT JOIN order_products opr on ord.id = opr.order_id&lt;/P&gt;&lt;P&gt;LEFT JOIN order_product_inventory opi on opr.refunded_order_product_id = opi.order_product_id&lt;/P&gt;&lt;P&gt;WHERE ord.order_type = 'refund'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Feb 2018 00:18:24 GMT</pubDate>
    <dc:creator>ryan_giebel</dc:creator>
    <dc:date>2018-02-07T00:18:24Z</dc:date>
    <item>
      <title>Conditional Join in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/Conditional-Join-in-Qlik-Sense/m-p/62170#M4103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to join two QVD tables based on a field in a third table (since the primary key in the first table will not have a match in the third table for products that are refunded). The field in the third table contains order_type field which is the base for my conditional join. Is there a way to have a conditional join in the load script to make this possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tables:&lt;/P&gt;&lt;P&gt;1. order_products&lt;/P&gt;&lt;P&gt;2. order_product_inventory&lt;/P&gt;&lt;P&gt;3.&lt;SPAN style="font-size: 13.3333px;"&gt; orders&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below are the two conditions:&lt;/P&gt;&lt;P&gt;#1. if orders.order_type &amp;lt;&amp;gt; 'refund' join &lt;SPAN style="font-size: 13.3333px;"&gt;order_products.&lt;STRONG&gt;id&lt;/STRONG&gt; to &lt;/SPAN&gt;order_product_inventory.&lt;STRONG&gt;order_product_id &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;#2. if orders.order_type = 'refund' join &lt;SPAN style="font-size: 13.3333px;"&gt;order_products.&lt;/SPAN&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;refunded_order_product_id &lt;/STRONG&gt;to &lt;SPAN style="font-size: 13.3333px;"&gt;order_product_inventory.&lt;STRONG style="font-size: 13.3333px;"&gt;order_product_id&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you'd like to see the sql query for the two conditions, see below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#1 order_type &amp;lt;&amp;gt; 'refund'&lt;/P&gt;&lt;P&gt;Select *&lt;/P&gt;&lt;P&gt;FROM orders ord&lt;/P&gt;&lt;P&gt;LEFT JOIN order_products opr on ord.id = opr.order_id&lt;/P&gt;&lt;P&gt;LEFT JOIN order_product_inv opi on opr.id = opi.order_product_id&lt;/P&gt;&lt;P&gt;WHERE ord.order_type &amp;lt;&amp;gt; 'refund'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#2 order_type = 'refund'&lt;/P&gt;&lt;P&gt;Select * &lt;/P&gt;&lt;P&gt;FROM orders ord &lt;/P&gt;&lt;P&gt;LEFT JOIN order_products opr on ord.id = opr.order_id&lt;/P&gt;&lt;P&gt;LEFT JOIN order_product_inventory opi on opr.refunded_order_product_id = opi.order_product_id&lt;/P&gt;&lt;P&gt;WHERE ord.order_type = 'refund'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Feb 2018 00:18:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Conditional-Join-in-Qlik-Sense/m-p/62170#M4103</guid>
      <dc:creator>ryan_giebel</dc:creator>
      <dc:date>2018-02-07T00:18:24Z</dc:date>
    </item>
  </channel>
</rss>

