<?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 sql join problem in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/sql-join-problem/m-p/2243710#M30109</link>
    <description>&lt;P&gt;Hello Community !&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'm trying to solve a problem which consist in :&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;1/ My first input :&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;SELECT count(FileName) as number,&lt;BR /&gt;FileName&lt;BR /&gt;FROM mvt_Ods&lt;BR /&gt;group by FileName&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;2/ My second input :&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;SELECT count(FileName) as numberCondition,&lt;BR /&gt;FileName&lt;BR /&gt;&lt;BR /&gt;FROM mvt_Ods&lt;BR /&gt;where Return_Mark!=' ' and PackingList_Type!='P'&lt;BR /&gt;group by FileName&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;3/ A table in my database : mvt_Ods which containt Return_Mark, PackingList_Type, FileName and other attributes&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;&lt;SPAN&gt;To summarize I must check the conditions:
Return_Mark! = '' And PackingList_Type! = 'P'
If both of these conditions are true I must get the FileName field
and then in a tMap I have to create a table that does not contain the rows that have been checked by both conditions

Note :
the number of rows that satisfy both conditions for the same FileName must be equal to the number of rows in FileName

Example:
Return_Mark! = '' And PackingList_Type! = 'P' =&amp;gt; Result:
FileName A: 100 lines
FileName B: 200 Lines

Number of lines for:
100
B: 300

For my output I have to remove A and keep only B&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Mar 2019 17:05:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-03-11T17:05:04Z</dc:date>
    <item>
      <title>sql join problem</title>
      <link>https://community.qlik.com/t5/Talend-Studio/sql-join-problem/m-p/2243710#M30109</link>
      <description>&lt;P&gt;Hello Community !&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'm trying to solve a problem which consist in :&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;1/ My first input :&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;SELECT count(FileName) as number,&lt;BR /&gt;FileName&lt;BR /&gt;FROM mvt_Ods&lt;BR /&gt;group by FileName&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;2/ My second input :&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;SELECT count(FileName) as numberCondition,&lt;BR /&gt;FileName&lt;BR /&gt;&lt;BR /&gt;FROM mvt_Ods&lt;BR /&gt;where Return_Mark!=' ' and PackingList_Type!='P'&lt;BR /&gt;group by FileName&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;3/ A table in my database : mvt_Ods which containt Return_Mark, PackingList_Type, FileName and other attributes&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;&lt;SPAN&gt;To summarize I must check the conditions:
Return_Mark! = '' And PackingList_Type! = 'P'
If both of these conditions are true I must get the FileName field
and then in a tMap I have to create a table that does not contain the rows that have been checked by both conditions

Note :
the number of rows that satisfy both conditions for the same FileName must be equal to the number of rows in FileName

Example:
Return_Mark! = '' And PackingList_Type! = 'P' =&amp;gt; Result:
FileName A: 100 lines
FileName B: 200 Lines

Number of lines for:
100
B: 300

For my output I have to remove A and keep only B&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 17:05:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/sql-join-problem/m-p/2243710#M30109</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-11T17:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: sql join problem</title>
      <link>https://community.qlik.com/t5/Talend-Studio/sql-join-problem/m-p/2243711#M30110</link>
      <description>&lt;P&gt;I didn't understand you but maybe this helps you:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;This should give you list of filenames where both of conditions are true and number of filenames where both of conditions are true is the same as number of all records with this filename (another way, this is the list of filenames for which in 100% of cases both conditions are true)&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;SELECT FileName,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;count(*) as number&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FROM mvt_Ods&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;group by FileName&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;HAVING&amp;nbsp;SUM(CASE WHEN Return_Mark &amp;lt;&amp;gt; ' ' and PackingList_Type &amp;lt;&amp;gt; 'P' THEN 1 ELSE 0 END) &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;count(*)&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;I don't know which type of database do you use (MySQL, MSSQL, Oracle...)&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 19:11:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/sql-join-problem/m-p/2243711#M30110</guid>
      <dc:creator>DataTeam1</dc:creator>
      <dc:date>2019-03-11T19:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: sql join problem</title>
      <link>https://community.qlik.com/t5/Talend-Studio/sql-join-problem/m-p/2243712#M30111</link>
      <description>&lt;P&gt;Hello DataTeam,&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'm using SQL Server&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I have a table wich contains&amp;nbsp;&lt;SPAN&gt;Return_Mark,&amp;nbsp;PackingList_Type and FileName and other columns.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;For example the result of&amp;nbsp; &amp;nbsp; &lt;STRONG&gt;Return_Mark!=' ' &amp;amp;&amp;amp; PackingList_Type !='P'&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;is&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;for FileName ='A' : 100 rows&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;for FileName ='B' : 200 rows&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;And the result of &lt;STRONG&gt;distinct count(FileName)&amp;nbsp;&lt;/STRONG&gt;is&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;for FileName ='A' : 100 rows&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;for FileName ='B' : 300 rows&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;FileName='A'&amp;nbsp;&lt;/STRONG&gt;have the same number of rows for the two queries so I have create a new table wich contain the other FileName(s) and for this example it's&amp;nbsp;&lt;STRONG&gt;FileName ='B'.&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 08:06:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/sql-join-problem/m-p/2243712#M30111</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-12T08:06:25Z</dc:date>
    </item>
  </channel>
</rss>

