<?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: Consecutive left joins? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Consecutive-left-joins/m-p/757969#M1049237</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can't join this table in Roster because there are already the two fields CustomerID and Status.&amp;nbsp; depending on what your data is about you could concatenate the last table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Roster:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Store ID,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Customer ID,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Revenue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\QVD\Roster.qvd]&lt;/P&gt;&lt;P&gt;(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join(Roster)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Store ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Status&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\External Data\Adds.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Store);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concantenate (Roster)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Customer ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Status&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\External Data\Adds.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Customer);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or join the last table renaming the field status:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concantenate (Roster)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Customer ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Status as StatusCustID&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\External Data\Adds.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Customer);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could then try (but this depends on your data)&lt;/P&gt;&lt;P&gt;New_Status:&lt;/P&gt;&lt;P&gt;load*,&lt;/P&gt;&lt;P&gt;if(isnull(Status), StatusCustID, Status) as Status_new&lt;/P&gt;&lt;P&gt;Resident Roster;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table Roster;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop fields Status, StatusCustID from New_Status;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Nov 2014 20:10:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-11-03T20:10:31Z</dc:date>
    <item>
      <title>Consecutive left joins?</title>
      <link>https://community.qlik.com/t5/QlikView/Consecutive-left-joins/m-p/757968#M1049236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Having trouble with something that seems simple but isn't working...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a simplified example of the data where we have multiple customers and customers can have multiple stores:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Store ID&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Customer ID&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Revenue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To track and trend "same store" growth, I want to flag new and lost customers and stores. I started with a simple left join to add in new stores for existing customers: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Store ID&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Status&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if we get 2 new customers, it is easier to flag an entire customer ID with a left join rather than drop 100s of Store IDs into the file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Customer ID&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Status&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my code looks something like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Roster:&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Store ID,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Customer ID,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Revenue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\QVD\Roster.qvd]&lt;/P&gt;&lt;P&gt;(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join(Roster)&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Store ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Status&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\External Data\Adds.xlsx]&lt;/P&gt;&lt;P&gt; (ooxml, embedded labels, table is Store);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join(Roster)&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Customer ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Status&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\External Data\Adds.xlsx]&lt;/P&gt;&lt;P&gt; (ooxml, embedded labels, table is Customer);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The resulting roster table does not capture the second left join. Is there something wrong with the logic of this approach? Or do I need to scrub my code? Thanks in advance. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 19:59:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Consecutive-left-joins/m-p/757968#M1049236</guid>
      <dc:creator>erjohnso</dc:creator>
      <dc:date>2014-11-03T19:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: Consecutive left joins?</title>
      <link>https://community.qlik.com/t5/QlikView/Consecutive-left-joins/m-p/757969#M1049237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can't join this table in Roster because there are already the two fields CustomerID and Status.&amp;nbsp; depending on what your data is about you could concatenate the last table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Roster:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Store ID,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Customer ID,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Revenue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\QVD\Roster.qvd]&lt;/P&gt;&lt;P&gt;(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join(Roster)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Store ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Status&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\External Data\Adds.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Store);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concantenate (Roster)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Customer ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Status&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\External Data\Adds.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Customer);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or join the last table renaming the field status:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concantenate (Roster)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Customer ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Status as StatusCustID&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\External Data\Adds.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Customer);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could then try (but this depends on your data)&lt;/P&gt;&lt;P&gt;New_Status:&lt;/P&gt;&lt;P&gt;load*,&lt;/P&gt;&lt;P&gt;if(isnull(Status), StatusCustID, Status) as Status_new&lt;/P&gt;&lt;P&gt;Resident Roster;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table Roster;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop fields Status, StatusCustID from New_Status;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 20:10:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Consecutive-left-joins/m-p/757969#M1049237</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-03T20:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Consecutive left joins?</title>
      <link>https://community.qlik.com/t5/QlikView/Consecutive-left-joins/m-p/757970#M1049238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you! Concatenate! Of course! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 20:11:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Consecutive-left-joins/m-p/757970#M1049238</guid>
      <dc:creator>erjohnso</dc:creator>
      <dc:date>2014-11-03T20:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Consecutive left joins?</title>
      <link>https://community.qlik.com/t5/QlikView/Consecutive-left-joins/m-p/757971#M1049239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is because it is trying to join where both customer ID and status match (synthetic key).&amp;nbsp; Since it is a left join, if it finds no matches (where both status and customer id match) it wont bring in any records.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 20:12:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Consecutive-left-joins/m-p/757971#M1049239</guid>
      <dc:creator>jpapador</dc:creator>
      <dc:date>2014-11-03T20:12:49Z</dc:date>
    </item>
  </channel>
</rss>

