<?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 Script is not working with LEFT JOIN in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Script-is-not-working-with-LEFT-JOIN/m-p/214873#M713206</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi James,&lt;/P&gt;&lt;P&gt;Assumption : Since you are using Left join its only fetching data with respect to above table hence its not fetching missing data from below.&lt;/P&gt;&lt;P&gt;Use only join and check.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Apr 2011 05:19:16 GMT</pubDate>
    <dc:creator>deepakk</dc:creator>
    <dc:date>2011-04-14T05:19:16Z</dc:date>
    <item>
      <title>Script is not working with LEFT JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/Script-is-not-working-with-LEFT-JOIN/m-p/214872#M713205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning all,&lt;/P&gt;&lt;P&gt;Let me preface this by saying I know that this will be hard to understand as there is so much information, fingers crossed I make some sort of sense though.&lt;/P&gt;&lt;P&gt;Situation summary:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I have an Excel spreadsheet with 2 tabs - this spreadsheet contains Budget information by SalesPerson and Customer. &lt;OL&gt;&lt;LI&gt;Tab 1 (called &lt;STRONG&gt;SalesBudget$&lt;/STRONG&gt;) - this contains the current year budgets&lt;/LI&gt;&lt;LI&gt;Tab 2 (called &lt;STRONG&gt;PreviousYearSalesBudget$) -&lt;/STRONG&gt; - this contains the previous year budge&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;I am using ODBC to connect to a Financial package to extract actual Sales by SalesPerson and Customer.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I have found a way to join all the data together to create 1 table in Qlikview called &lt;STRONG&gt;SALESACTUAL&lt;/STRONG&gt;, however my problem is ensuring that table contains all the information I need.&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;STEP 1 - LOAD the first tab from the Spreadsheet - OK - no issues here&lt;/B&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P style="font-weight: bold; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;&lt;/P&gt;&lt;P style="font-style: italic; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;[SalesActual]:&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;LOAD&lt;/B&gt; SalesPerson_Code,&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;Customer_Code,&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;Budget_Amount,&lt;/P&gt;&lt;P style="font-weight: bold; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;FROM&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;(biff, embedded labels, table is SalesBudget$);&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;STEP 2 - Load the second tab from the spreadsheet into the new table - OK - no issues here&lt;/B&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;CONCATENATE&lt;/B&gt; (SalesActual)&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;LOAD&lt;/B&gt; SalesPerson_Code,&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;Customer_Code,&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;Budget_Amount,&lt;/P&gt;&lt;P style="font-weight: bold; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;FROM&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;(biff, embedded labels, table is PreviousYearSalesBudget$);&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;Step 3 - As I am missing data from the spreadsheet this loads the missing data into the table - OK - no issues here&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;/P&gt;&lt;P style="font-weight: bold; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;//This adds the customer OID to the previous table as it is needed to join to customer table later on&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;LEFT&lt;/B&gt; &lt;B&gt;JOIN&lt;/B&gt; (&lt;I&gt;SalesActual&lt;/I&gt;)&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;LOAD&lt;/B&gt; code &lt;B&gt;as&lt;/B&gt; Customer_Code,&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;oid &lt;B&gt;as&lt;/B&gt; myCustomer;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;SQL&lt;/B&gt; &lt;B&gt;SELECT&lt;/B&gt; code,&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;oid&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;FROM&lt;/B&gt; Customer;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;/P&gt;&lt;P style="font-weight: bold; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;//This adds the Salesperson OID and SalesPerson_Code to the previous table&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;LEFT&lt;/B&gt; &lt;B&gt;JOIN&lt;/B&gt; (&lt;I&gt;SalesActual&lt;/I&gt;)&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;LOAD&lt;/B&gt; code &lt;B&gt;as&lt;/B&gt; SalesPerson_Code,&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;oid &lt;B&gt;as&lt;/B&gt; mySalesPerson;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;SQL&lt;/B&gt; &lt;B&gt;SELECT&lt;/B&gt; code,&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;oid&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;FROM&lt;/B&gt; SalesPerson;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;Step 4 - This loads the ACTUAL data into the table - OK - no issues here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;STRONG&gt;//This adds the ACTUAL values to the previous table as new rows&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;STRONG&gt;CONCATENATE&lt;/STRONG&gt; (SalesActual)&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt; date,&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;myCustomer,&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;mySalesPerson,&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;netAmount;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;STRONG&gt;SQL&lt;/STRONG&gt; &lt;STRONG&gt;SELECT&lt;/STRONG&gt; *&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt; SAAnalysisLine;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;This is where I hit my issue. I need to add in the missing data into the table. The rows that I added in Step 3 are missing the SalesPerson_Code and the Customer_Code, thus this section of the script tries to add them in. For some reason this runs, however the missing information is not added into the combined table.&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;/P&gt;&lt;P style="font-weight: bold; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;//This adds the Salesperson OID and SalesPerson_Code to the previous table&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;LEFT&lt;/B&gt; &lt;B&gt;JOIN&lt;/B&gt; (&lt;I&gt;SalesActual&lt;/I&gt;)&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;LOAD&lt;/B&gt; oid &lt;B&gt;as&lt;/B&gt; mySalesPerson,&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;code &lt;B&gt;as&lt;/B&gt; SalesPerson_Code;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;SQL&lt;/B&gt; &lt;B&gt;SELECT&lt;/B&gt; oid,&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;code&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;FROM&lt;/B&gt; SalesPerson;&lt;/P&gt;&lt;P style="font-weight: bold; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;&lt;/P&gt;&lt;P style="font-weight: bold; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;//This adds the customer OID to the previous table&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;LEFT&lt;/B&gt; &lt;B&gt;JOIN&lt;/B&gt; (&lt;I&gt;SalesActual&lt;/I&gt;)&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;LOAD&lt;/B&gt; oid &lt;B&gt;as&lt;/B&gt; myCustomer,&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;code &lt;B&gt;as&lt;/B&gt; Customer_Code;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;SQL&lt;/B&gt; &lt;B&gt;SELECT&lt;/B&gt; oid,&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;code&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that I have detailed that so that someone can see and understand my issue.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2011 03:23:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-is-not-working-with-LEFT-JOIN/m-p/214872#M713205</guid>
      <dc:creator />
      <dc:date>2011-04-14T03:23:01Z</dc:date>
    </item>
    <item>
      <title>Script is not working with LEFT JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/Script-is-not-working-with-LEFT-JOIN/m-p/214873#M713206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi James,&lt;/P&gt;&lt;P&gt;Assumption : Since you are using Left join its only fetching data with respect to above table hence its not fetching missing data from below.&lt;/P&gt;&lt;P&gt;Use only join and check.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2011 05:19:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-is-not-working-with-LEFT-JOIN/m-p/214873#M713206</guid>
      <dc:creator>deepakk</dc:creator>
      <dc:date>2011-04-14T05:19:16Z</dc:date>
    </item>
    <item>
      <title>Script is not working with LEFT JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/Script-is-not-working-with-LEFT-JOIN/m-p/214874#M713207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the third step, you can use join statement alone instead of using Left join. So it will add the missing data.&lt;/P&gt;&lt;P&gt;Third step, you are using left join so you will get the superset of the top table and subset of the bottom table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2011 05:34:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-is-not-working-with-LEFT-JOIN/m-p/214874#M713207</guid>
      <dc:creator />
      <dc:date>2011-04-14T05:34:13Z</dc:date>
    </item>
    <item>
      <title>Script is not working with LEFT JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/Script-is-not-working-with-LEFT-JOIN/m-p/214875#M713208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;James&lt;/P&gt;&lt;P&gt;I see two potential problems with the code:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Looking at the first of your "problem queries" - the fields mySalesPerson and SalesPerson Code already exist in the table. This means the left join will load only those rows matching BOTH of these fields (ie join on both fields). As there is no other field in the query, this does not add any data to your SalesActual table, even if the query returns data. In other words, it is only returning the join fields.&lt;/LI&gt;&lt;LI&gt;Although this was not part of your question, I see a problem with Step1 and Step2 - you do not differentiate between the values for SalesBudget$ and PreviousYearSalesBudget$. Do you need a Date field?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;You may need to construct the table in two parts and then concatenate the two parts for the the final table. Steps 1-3 would be the first table (it does not need to be renamed). For Step 4, construct a separate table (eg tmpActualSales), and run the three queries that build the table. Once done, add something like:&lt;/P&gt;&lt;P&gt;Concatenate (ActualSales)&lt;BR /&gt;LOAD * Resident tmpActualSales;&lt;/P&gt;&lt;P&gt;DROP Table tmpActualSales;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;BR /&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2011 07:48:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-is-not-working-with-LEFT-JOIN/m-p/214875#M713208</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2011-04-14T07:48:29Z</dc:date>
    </item>
    <item>
      <title>Script is not working with LEFT JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/Script-is-not-working-with-LEFT-JOIN/m-p/214876#M713209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good afternoon all,&lt;/P&gt;&lt;P&gt;Thank you all for the many and varied responses, it is very much appreciated &lt;IMG alt="Smile" src="http://community.qlik.com/emoticons/emotion-1.gif" /&gt;&lt;/P&gt;&lt;P&gt;I have got it all working now.&lt;/P&gt;&lt;P&gt;Result was that I created 2 MAPPING LOAD tables right at the start and then used APPLYMAP function to add in the fields.&lt;/P&gt;&lt;P&gt;This seems to have fixed my little problem.&lt;/P&gt;&lt;P&gt;Once again thank you to everyone that answered.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2011 08:07:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-is-not-working-with-LEFT-JOIN/m-p/214876#M713209</guid>
      <dc:creator />
      <dc:date>2011-04-14T08:07:15Z</dc:date>
    </item>
  </channel>
</rss>

