<?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 Creating a Column in a Joined Table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Creating-a-Column-in-a-Joined-Table/m-p/1122531#M634256</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm attempting to calculate the number of days on lot for our inventory records.&amp;nbsp; This is calculated in the following way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Sale Date]&amp;nbsp; -&amp;nbsp; [Arrival Date]&lt;BR /&gt;If no sale date,&amp;nbsp; Today - [Arrival Date]&lt;/P&gt;&lt;P&gt;If it hasn't arrived, Days on Lot should be null&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've implemented this in the following manner in my Qlikview Script.&amp;nbsp; It's pulling data from the Arrival Date and Sale Date table and populating accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;OrderLines:&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;LOAD *,&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;IF(ISNULL([SaleDate]),(Today()-[ArrivalDate]),IF(ISNULL([ArrivalDate]),null(),([SaleDate]-[ArrivalDate]))) as DOL;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;LOAD RowNo() as OrderLineID, RTADD08_ORDER_GOTD_D, RTAD06_ORDER_ARRIVAL_DATE_K as ArrivalDateK, RTAD06_ORDER_SALE_DATE_K as SaleDateK&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;RESIDENT Order;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;LEFT JOIN&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;LOAD RTAD06_ORDER_ARRIVAL_DATE_K as ArrivalDateK, ARRIVAL_FULL_USA as ArrivalDate&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;RESIDENT ArrivalDate;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;LEFT JOIN&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;LOAD RTAD06_ORDER_SALE_DATE_K as SaleDateK, SALE_FULL_USA as SaleDate&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;RESIDENT SaleDate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately when I add my Days On Lot calculation ("DOL"), it says that the field 'SaleDate' cannot be found.&amp;nbsp; Any idea where I'm going about this wrong?&amp;nbsp; Do I need to make another table entirely?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also note, this OrderLines table is an intermediary table to support SaleDate and ArrivalDate being linked to a canonical date per &lt;A href="https://community.qlik.com/qlik-users/4003"&gt;hic&lt;/A&gt;‌'s &lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2014/02/17/canonical-date"&gt;canonical date method&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated!&amp;nbsp; Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 May 2016 14:00:22 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-05-11T14:00:22Z</dc:date>
    <item>
      <title>Creating a Column in a Joined Table</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-Column-in-a-Joined-Table/m-p/1122531#M634256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm attempting to calculate the number of days on lot for our inventory records.&amp;nbsp; This is calculated in the following way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Sale Date]&amp;nbsp; -&amp;nbsp; [Arrival Date]&lt;BR /&gt;If no sale date,&amp;nbsp; Today - [Arrival Date]&lt;/P&gt;&lt;P&gt;If it hasn't arrived, Days on Lot should be null&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've implemented this in the following manner in my Qlikview Script.&amp;nbsp; It's pulling data from the Arrival Date and Sale Date table and populating accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;OrderLines:&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;LOAD *,&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;IF(ISNULL([SaleDate]),(Today()-[ArrivalDate]),IF(ISNULL([ArrivalDate]),null(),([SaleDate]-[ArrivalDate]))) as DOL;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;LOAD RowNo() as OrderLineID, RTADD08_ORDER_GOTD_D, RTAD06_ORDER_ARRIVAL_DATE_K as ArrivalDateK, RTAD06_ORDER_SALE_DATE_K as SaleDateK&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;RESIDENT Order;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;LEFT JOIN&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;LOAD RTAD06_ORDER_ARRIVAL_DATE_K as ArrivalDateK, ARRIVAL_FULL_USA as ArrivalDate&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;RESIDENT ArrivalDate;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;LEFT JOIN&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;LOAD RTAD06_ORDER_SALE_DATE_K as SaleDateK, SALE_FULL_USA as SaleDate&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;RESIDENT SaleDate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately when I add my Days On Lot calculation ("DOL"), it says that the field 'SaleDate' cannot be found.&amp;nbsp; Any idea where I'm going about this wrong?&amp;nbsp; Do I need to make another table entirely?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also note, this OrderLines table is an intermediary table to support SaleDate and ArrivalDate being linked to a canonical date per &lt;A href="https://community.qlik.com/qlik-users/4003"&gt;hic&lt;/A&gt;‌'s &lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2014/02/17/canonical-date"&gt;canonical date method&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated!&amp;nbsp; Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 May 2016 14:00:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-Column-in-a-Joined-Table/m-p/1122531#M634256</guid>
      <dc:creator />
      <dc:date>2016-05-11T14:00:22Z</dc:date>
    </item>
  </channel>
</rss>

