<?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: Dates in load script not being treated as dates (maybe?) in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Dates-in-load-script-not-being-treated-as-dates-maybe/m-p/2514251#M14784</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22035"&gt;@marksouzacosta&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your reply, however I still get the same behaviour in that I get a left justified "date" and no null values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I changed it to DD/MM/YYYY as that's the format in which my timestamps I need to join, are in.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Oggy172_1-1744634545782.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/179608iD9E961BB25486626/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Oggy172_1-1744634545782.png" alt="Oggy172_1-1744634545782.png" /&gt;&lt;/span&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>Mon, 14 Apr 2025 12:42:33 GMT</pubDate>
    <dc:creator>Oggy172</dc:creator>
    <dc:date>2025-04-14T12:42:33Z</dc:date>
    <item>
      <title>Dates in load script not being treated as dates (maybe?)</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Dates-in-load-script-not-being-treated-as-dates-maybe/m-p/2514067#M14781</link>
      <description>&lt;P&gt;I've got a bit of an issue I've come across, when migrating an existing report from QV to QS.&lt;/P&gt;&lt;P&gt;It performs an interval match to apply 'costs' at a point in time to their production date.&lt;/P&gt;&lt;P&gt;In the existing report, it is taking a Date field from a qvd, that was output as &lt;STRONG&gt;YYYYYMMDD&lt;/STRONG&gt; --&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;if(text(date("Production Date-Time", 'YYYYMMDD')) &amp;lt;&amp;gt; '17530101',
   date(floor("Posting Date"), 'YYYYMMDD'),
   date(floor("Posting Date"))) as JOIN_Date;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When this is loaded back into a QV document - it is taking this as &lt;STRONG&gt;DD/MM/YYYY&lt;/STRONG&gt; format, I presume due to the &lt;STRONG&gt;DateFormat='DD/MM/YYYY'&lt;/STRONG&gt; section application&lt;/P&gt;&lt;LI-CODE lang="css"&gt;LOAD 
'x-' &amp;amp; RowNo()	AS	pId,
1		AS	ProductionFlag,
0		AS	ConsumptionFlag,		
'1-' &amp;amp; [Entry No_] &amp;amp; '-' &amp;amp; JOIN_item &amp;amp; '-' &amp;amp; Company			AS	JOIN_PRODUCTION_SUMMARY, 	
JOIN_item &amp;amp; '-' &amp;amp; Date(JOIN_Date, 'YYYYMMDD')	AS	JOIN_PROD_ITEM_RC, 
Quantity	AS 	[BOM Allocated Quantity],
[Entry No_], 
Company, 
UPPER(Company)	AS	SECURITY_COMPANY,
JOIN_item, 
[Production BOM No_], 
Date, 
[Entry Type], 
[Entry Type Desc], 
[Production BOM No_] &amp;amp; '-' &amp;amp; Date(JOIN_Date, 'YYYYMMDD')		AS	JOIN_BoM_ILE, 
		[Source No_], 
		[Document No_], 
		[Location Code],  
		[Production Date-Time], 
		JOIN_Date
	FROM
		// D:\qlik\datasources\qvd\ILE.Production.qvd
		[D:\qlik\datasources\Qlikview - QlikSaaS\ILE.Production.qvd]
	(qvd)
	where text(date(JOIN_Date,'YYYYMMDD')) &amp;gt;='20220703';&lt;/LI-CODE&gt;&lt;P&gt;and these are right justified, which suggests they are correctly formatted as a date.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Oggy172_0-1744384874289.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/179572iFF05D200027677F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Oggy172_0-1744384874289.png" alt="Oggy172_0-1744384874289.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;However, when I've ported these over to QlikSense, I get strange behaviour - the output to .qvd works the same&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Creation of .qvd&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Oggy172_1-1744385147851.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/179573i9B8B67D3321A146D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Oggy172_1-1744385147851.png" alt="Oggy172_1-1744385147851.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;DateFormat&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Oggy172_2-1744385292876.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/179574iD312353A41A2AFDD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Oggy172_2-1744385292876.png" alt="Oggy172_2-1744385292876.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Load Script&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LOAD 
'x-' &amp;amp; RowNo()	AS	pId,
1		AS	ProductionFlag,
0		AS	ConsumptionFlag,		
'1-' &amp;amp; [Entry No_] &amp;amp; '-' &amp;amp; JOIN_item &amp;amp; '-' &amp;amp; Company			AS	JOIN_PRODUCTION_SUMMARY, 

JOIN_item &amp;amp; '-' &amp;amp; Date(JOIN_Date, 'YYYYMMDD')					AS	JOIN_PROD_ITEM_RC, 

Quantity	AS 	[BOM Allocated Quantity],
[Entry No_], 
Company, 
UPPER(Company)	AS	SECURITY_COMPANY,
JOIN_item, 
[Production BOM No_], 
Date, 
[Entry Type], 
[Entry Type Desc], 
[Production BOM No_] &amp;amp; '-' &amp;amp; Date(JOIN_Date, 'YYYYMMDD')		AS	JOIN_BoM_ILE, 

[Source No_], 
[Document No_], 
[Location Code],  
[Production Date-Time], 
JOIN_Date

FROM	
[lib://QVD Data:Office_365_Sharepoint - a@b.com/Shared Documents/QlikSaaS/BC Testing/qvd/BC_ILE_Production.qvd]	(qvd)	
where 
date(JOIN_Date) &amp;gt;=44745;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but the date outputs are not converted back&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Oggy172_3-1744385552304.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/179575iBA44FE803CEBFF1F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Oggy172_3-1744385552304.png" alt="Oggy172_3-1744385552304.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;date(JOIN_Date, 'DD/MM/YYYY') as JOIN_Date left justifies them, so fail the interval match&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Oggy172_0-1744386483416.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/179577iBA74C16E5E9154F4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Oggy172_0-1744386483416.png" alt="Oggy172_0-1744386483416.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone put me out of my misery?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Apr 2025 15:48:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Dates-in-load-script-not-being-treated-as-dates-maybe/m-p/2514067#M14781</guid>
      <dc:creator>Oggy172</dc:creator>
      <dc:date>2025-04-11T15:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Dates in load script not being treated as dates (maybe?)</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Dates-in-load-script-not-being-treated-as-dates-maybe/m-p/2514094#M14783</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/318663"&gt;@Oggy172&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;There are lots of things I would like to review in your code but, you can try the following:&lt;/P&gt;&lt;P&gt;Use&amp;nbsp;&lt;STRONG&gt;Date(Date#(JOIN_Date, 'YYYYMMDD'), 'YYYYMMDD')&lt;/STRONG&gt;&lt;BR /&gt;instead of &lt;STRONG&gt;Date(JOIN_Date, 'YYYYMMDD')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Date#&lt;/STRONG&gt; function is telling to Qlik that &lt;STRONG&gt;JOIN_Date&lt;/STRONG&gt; values are date values with the format 'YYYYMMDD'.&lt;BR /&gt;While &lt;STRONG&gt;Date&lt;/STRONG&gt; is formatting the date value to the 'YYYYMMDD' format.&lt;BR /&gt;So, first you are making sure that the values are properly converted to date and then formatting to YYYYMMDD. Null values are indications of problems.&lt;/P&gt;&lt;P&gt;Also I would avoid converting dates to text to do data comparison.&lt;BR /&gt;For example, in your where clause, you could do this:&lt;BR /&gt;&lt;STRONG&gt;where date#(JOIN_Date,'YYYYMMDD') &amp;gt;= MakeDate(2022,7,3);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Mark Costa&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Apr 2025 21:11:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Dates-in-load-script-not-being-treated-as-dates-maybe/m-p/2514094#M14783</guid>
      <dc:creator>marksouzacosta</dc:creator>
      <dc:date>2025-04-11T21:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Dates in load script not being treated as dates (maybe?)</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Dates-in-load-script-not-being-treated-as-dates-maybe/m-p/2514251#M14784</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22035"&gt;@marksouzacosta&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your reply, however I still get the same behaviour in that I get a left justified "date" and no null values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I changed it to DD/MM/YYYY as that's the format in which my timestamps I need to join, are in.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Oggy172_1-1744634545782.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/179608iD9E961BB25486626/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Oggy172_1-1744634545782.png" alt="Oggy172_1-1744634545782.png" /&gt;&lt;/span&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>Mon, 14 Apr 2025 12:42:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Dates-in-load-script-not-being-treated-as-dates-maybe/m-p/2514251#M14784</guid>
      <dc:creator>Oggy172</dc:creator>
      <dc:date>2025-04-14T12:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: Dates in load script not being treated as dates (maybe?)</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Dates-in-load-script-not-being-treated-as-dates-maybe/m-p/2514274#M14785</link>
      <description>&lt;P&gt;I believe it may have been working ok and there just wasnt enough data in my tables to fall within the interval match.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still strange that Qlik isn't applying the default formatting&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 14:57:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Dates-in-load-script-not-being-treated-as-dates-maybe/m-p/2514274#M14785</guid>
      <dc:creator>Oggy172</dc:creator>
      <dc:date>2025-04-14T14:57:43Z</dc:date>
    </item>
  </channel>
</rss>

