<?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: Join to ignore null values in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Join-to-ignore-null-values/m-p/1630524#M46945</link>
    <description>&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;In Qlik, JOIN is the same as &lt;A href="https://www.w3schools.com/sql/sql_join_full.asp" target="_self"&gt;FULL OUTER JOIN&lt;/A&gt;. What you want to do is &lt;A href="https://www.w3schools.com/sql/sql_join_inner.asp" target="_self"&gt;INNER JOIN&lt;/A&gt;&amp;nbsp;at the end to only keep the values which have entries in both tables.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mauritz&lt;/P&gt;</description>
    <pubDate>Wed, 02 Oct 2019 14:06:28 GMT</pubDate>
    <dc:creator>Mauritz_SA</dc:creator>
    <dc:date>2019-10-02T14:06:28Z</dc:date>
    <item>
      <title>Join to ignore null values</title>
      <link>https://community.qlik.com/t5/App-Development/Join-to-ignore-null-values/m-p/1630513#M46944</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having an issue with Joins.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When Qlik joins two tables, it seems like it doesn't ignore null values. If a value is null in both tables, it will consider them as different and generate two separate rows. Coming from a SQL world, I find this counter-intuitive and even counter-productive. In the attached example and code below, I would expect only one row for ID 2, with Name = Brian, Status = Null(), Colour = Blue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a best way to fix it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tmpNames:
Load
	*
Inline
[
	ID, Name
    1, Andy
    2, Brian
    3, Carl
    4, David
];

Left Join (tmpNames)
Load
	*
Inline
[
	ID, Status
    1, 1
    3, 0
];

// tmpNames Result:
//       ID, Name, Status
//       1, Andy, 1
//       2, Brian, Null()
//       3, Carl, 0
//       4, David, Null()

tmpColours:
NoConcatenate
Load 
	*
Inline
[
	ID, Colour
    1, Amber
    2, Blue
    3, Cyan
];

Left Join (tmpColours)
Load
	*
Inline
[
	ID, Status
    1, 1
    3, 1
];

// tmpColours result:
//       ID, Colour, Status
//       1, Amber, 1
//       2, Blue, Null()
//       3, Cyan, 1

Output:
NoConcatenate Load * Resident tmpNames;
Join (Output) Load * Resident tmpColours;

Drop Table tmpNames, tmpColours;&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="output example.png" style="width: 253px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/20528iDB34032CC47BEB40/image-size/large?v=v2&amp;amp;px=999" role="button" title="output example.png" alt="output example.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 13:53:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-to-ignore-null-values/m-p/1630513#M46944</guid>
      <dc:creator>fabios</dc:creator>
      <dc:date>2019-10-02T13:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Join to ignore null values</title>
      <link>https://community.qlik.com/t5/App-Development/Join-to-ignore-null-values/m-p/1630524#M46945</link>
      <description>&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;In Qlik, JOIN is the same as &lt;A href="https://www.w3schools.com/sql/sql_join_full.asp" target="_self"&gt;FULL OUTER JOIN&lt;/A&gt;. What you want to do is &lt;A href="https://www.w3schools.com/sql/sql_join_inner.asp" target="_self"&gt;INNER JOIN&lt;/A&gt;&amp;nbsp;at the end to only keep the values which have entries in both tables.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mauritz&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 14:06:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-to-ignore-null-values/m-p/1630524#M46945</guid>
      <dc:creator>Mauritz_SA</dc:creator>
      <dc:date>2019-10-02T14:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Join to ignore null values</title>
      <link>https://community.qlik.com/t5/App-Development/Join-to-ignore-null-values/m-p/1630542#M46947</link>
      <description>&lt;P&gt;Hi Mauritz,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm aware it's a full join. What I'm saying is that it doesn't behave as such. A SQL full join would treat null values as equal. Qlik doesn't and creates duplicate lines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Fabio&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 14:28:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-to-ignore-null-values/m-p/1630542#M46947</guid>
      <dc:creator>fabios</dc:creator>
      <dc:date>2019-10-02T14:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: Join to ignore null values</title>
      <link>https://community.qlik.com/t5/App-Development/Join-to-ignore-null-values/m-p/1630550#M46949</link>
      <description>&lt;P&gt;Join on Null values is an issue in Qlik... you can try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tmpNames:
LOAD * INLINE [
    ID, Name
    1, Andy
    2, Brian
    3, Carl
    4, David
];

Left Join (tmpNames)
LOAD * INLINE [
    ID, Status
    1, 1
    3, 0
];

tmpColours:
NoConcatenate
LOAD * INLINE [
    ID, Colour
    1, Amber
    2, Blue
    3, Cyan
];

Left Join (tmpColours)
LOAD * INLINE [
    ID, Status
    1, 1
    3, 1
];

Output:
NoConcatenate
LOAD *,
	 ID &amp;amp; Status as Key
Resident tmpNames;

Join (Output)
LOAD ID &amp;amp; Status as Key,
	 Colour
Resident tmpColours;

DROP Table tmpNames, tmpColours;&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 02 Oct 2019 14:40:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-to-ignore-null-values/m-p/1630550#M46949</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-10-02T14:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Join to ignore null values</title>
      <link>https://community.qlik.com/t5/App-Development/Join-to-ignore-null-values/m-p/1630554#M46950</link>
      <description>&lt;P&gt;Thanks Sunny!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hoped there would be a cleaner way... This is quite annoying when joining on several fields. &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know the reason for this design choice? I'm also surprised that this behaviour is not documented by Qlik.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 14:46:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-to-ignore-null-values/m-p/1630554#M46950</guid>
      <dc:creator>fabios</dc:creator>
      <dc:date>2019-10-02T14:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Join to ignore null values</title>
      <link>https://community.qlik.com/t5/App-Development/Join-to-ignore-null-values/m-p/1630556#M46951</link>
      <description>&lt;P&gt;Hi Fabio&lt;/P&gt;&lt;P&gt;Sorry, I misunderstood your question. We normally make key fields for joins, but that doesn't answer your question&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;.&lt;/P&gt;&lt;P&gt;Let's see what the rest of the guys say.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mauritz&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 14:47:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-to-ignore-null-values/m-p/1630556#M46951</guid>
      <dc:creator>Mauritz_SA</dc:creator>
      <dc:date>2019-10-02T14:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: Join to ignore null values</title>
      <link>https://community.qlik.com/t5/App-Development/Join-to-ignore-null-values/m-p/1630560#M46952</link>
      <description>&lt;P&gt;I am not sure why it is done this way, but may be&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6622"&gt;@hic&lt;/a&gt;&amp;nbsp;can comment on this.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 14:49:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-to-ignore-null-values/m-p/1630560#M46952</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-10-02T14:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: Join to ignore null values</title>
      <link>https://community.qlik.com/t5/App-Development/Join-to-ignore-null-values/m-p/1630563#M46953</link>
      <description>&lt;P&gt;One option is to use NullAsValue&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NULLASVALUE Status;

tmpNames:
LOAD * INLINE [
    ID, Name
    1, Andy
    2, Brian
    3, Carl
    4, David
];

Left Join (tmpNames)
LOAD * INLINE [
    ID, Status
    1, 1
    3, 0
];

tmpColours:
NoConcatenate
LOAD * INLINE [
    ID, Colour
    1, Amber
    2, Blue
    3, Cyan
];

Left Join (tmpColours)
LOAD * INLINE [
    ID, Status
    1, 1
    3, 1
];

Output:
NoConcatenate
LOAD *
Resident tmpNames;

Join (Output)
LOAD *
Resident tmpColours;

DROP Table tmpNames, tmpColours;

NULLASNULL Status;&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 02 Oct 2019 14:51:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-to-ignore-null-values/m-p/1630563#M46953</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-10-02T14:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: Join to ignore null values</title>
      <link>https://community.qlik.com/t5/App-Development/Join-to-ignore-null-values/m-p/1630589#M46955</link>
      <description>&lt;P&gt;THIS is a satisfactory solution!! Thanks a lot &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 15:09:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-to-ignore-null-values/m-p/1630589#M46955</guid>
      <dc:creator>fabios</dc:creator>
      <dc:date>2019-10-02T15:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Join to ignore null values</title>
      <link>https://community.qlik.com/t5/App-Development/Join-to-ignore-null-values/m-p/1631113#M46988</link>
      <description>&lt;P&gt;To my knowledge, NULL values in SQL outer joins never link to other NULL values.&lt;/P&gt;
&lt;P&gt;See for example&amp;nbsp;&lt;A href="http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc32300.1570/html/sqlug/X78356.htm" target="_blank"&gt;http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc32300.1570/html/sqlug/X78356.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;So I think that the Qlik engine is doing the correct thing.&lt;/P&gt;
&lt;P&gt;HIC&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 13:57:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-to-ignore-null-values/m-p/1631113#M46988</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2019-10-03T13:57:12Z</dc:date>
    </item>
  </channel>
</rss>

