<?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 Date# function weirdness during load in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Date-function-weirdness-during-load/m-p/1779556#M60599</link>
    <description>&lt;P&gt;I'm getting different results from the same load. The only difference is the use of "First 100000" before "Load."&lt;/P&gt;&lt;P&gt;My load script:&lt;/P&gt;&lt;P&gt;ins:&lt;BR /&gt;first 100000&lt;BR /&gt;LOAD&lt;BR /&gt;InsCardEffectiveDate,&lt;BR /&gt;date(floor(date#(InsCardEffectiveDate, 'M/D/YYYY hh:mm:ss tt'))) as PlanStartDate&lt;BR /&gt;From [file.qvd] (qvd);&lt;/P&gt;&lt;P&gt;The result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lauri_0-1612316556793.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/48318iAEE32F9226F5FFF6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Lauri_0-1612316556793.png" alt="Lauri_0-1612316556793.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It gets weird when I remove the "first 100000" and run the load:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lauri_1-1612316717502.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/48319i094B243244EFE794/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Lauri_1-1612316717502.png" alt="Lauri_1-1612316717502.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The source file has 96391 rows, so the "first 100000" shouldn't have had any impact! Any idea why this is happening?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Feb 2021 01:51:16 GMT</pubDate>
    <dc:creator>Lauri</dc:creator>
    <dc:date>2021-02-03T01:51:16Z</dc:date>
    <item>
      <title>Date# function weirdness during load</title>
      <link>https://community.qlik.com/t5/App-Development/Date-function-weirdness-during-load/m-p/1779556#M60599</link>
      <description>&lt;P&gt;I'm getting different results from the same load. The only difference is the use of "First 100000" before "Load."&lt;/P&gt;&lt;P&gt;My load script:&lt;/P&gt;&lt;P&gt;ins:&lt;BR /&gt;first 100000&lt;BR /&gt;LOAD&lt;BR /&gt;InsCardEffectiveDate,&lt;BR /&gt;date(floor(date#(InsCardEffectiveDate, 'M/D/YYYY hh:mm:ss tt'))) as PlanStartDate&lt;BR /&gt;From [file.qvd] (qvd);&lt;/P&gt;&lt;P&gt;The result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lauri_0-1612316556793.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/48318iAEE32F9226F5FFF6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Lauri_0-1612316556793.png" alt="Lauri_0-1612316556793.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It gets weird when I remove the "first 100000" and run the load:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lauri_1-1612316717502.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/48319i094B243244EFE794/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Lauri_1-1612316717502.png" alt="Lauri_1-1612316717502.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The source file has 96391 rows, so the "first 100000" shouldn't have had any impact! Any idea why this is happening?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 01:51:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-function-weirdness-during-load/m-p/1779556#M60599</guid>
      <dc:creator>Lauri</dc:creator>
      <dc:date>2021-02-03T01:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Date# function weirdness during load</title>
      <link>https://community.qlik.com/t5/App-Development/Date-function-weirdness-during-load/m-p/1779586#M60605</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/16128"&gt;@Lauri&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would believe that the error is in the DATE #, the format 'D / M / YYYY hh: mm: ss tt' is not correct for DATE #, it should be 'D / M / YYYY'.&lt;/P&gt;&lt;P&gt;On the other hand, is the InsCardEffectiveDate field a text string? In case of being a text string use timestamp #, otherwise use timestamp, and the format 'D / M / YYYY hh: mm: ss tt',&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;date(floor(timestamp#(InsCardEffectiveDate, 'M/D/YYYY hh:mm:ss tt'))) as PlanStartDate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;date(floor(timestamp(InsCardEffectiveDate, 'M/D/YYYY hh:mm:ss tt'))) as PlanStartDate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Joseph Morales&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 05:53:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-function-weirdness-during-load/m-p/1779586#M60605</guid>
      <dc:creator>JosephMorales</dc:creator>
      <dc:date>2021-02-03T05:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Date# function weirdness during load</title>
      <link>https://community.qlik.com/t5/App-Development/Date-function-weirdness-during-load/m-p/1779593#M60609</link>
      <description>&lt;P&gt;I agree, it looks like strange behaviour.&amp;nbsp;Are you solely running the sample load above or do you have other criterias in your Load?&lt;/P&gt;&lt;P&gt;It looks like your InsCardEffectiveDate is interpreted as a timestamp by default, if so then you don't need the advanced expression. Try using&lt;/P&gt;&lt;P&gt;dayname(InsCardEffectiveDate) as PlanStartDate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 06:48:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-function-weirdness-during-load/m-p/1779593#M60609</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2021-02-03T06:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Date# function weirdness during load</title>
      <link>https://community.qlik.com/t5/App-Development/Date-function-weirdness-during-load/m-p/1779758#M60629</link>
      <description>&lt;P&gt;Thank you, Vegar and Joseph. The load runs only the script that I included here. Based on your feedback, I tried a variety of functions.&lt;/P&gt;&lt;P&gt;Here are the results with "First 100000" - I named each field with the function(s):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lauri_5-1612358792556.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/48376iD68A60D135231C48/image-size/large?v=v2&amp;amp;px=999" role="button" title="Lauri_5-1612358792556.png" alt="Lauri_5-1612358792556.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here are the results without "First 100000":&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lauri_4-1612358752764.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/48374i45B94E9B30BE6181/image-size/large?v=v2&amp;amp;px=999" role="button" title="Lauri_4-1612358752764.png" alt="Lauri_4-1612358752764.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You are right that the simple Date and Dayname functions work here. But I would like to understand why the other functions behave differently! A bug? I'm on Sense June 2020. I get "good" results with "First X" no matter what X is.&lt;/P&gt;&lt;P&gt;And here is my current script:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier" size="2"&gt;ins: &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;// first 100000&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;LOAD &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;InsCardEffectiveDate as Original_Value,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Text(InsCardEffectiveDate) AS Text,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;date(InsCardEffectiveDate) AS Date,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;dayname(InsCardEffectiveDate) AS DayName,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;timestamp#(InsCardEffectiveDate, 'M/D/YYYY hh:mm:ss tt') as TimeStamp#,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;date(floor(timestamp#(InsCardEffectiveDate, 'M/D/YYYY hh:mm:ss tt'))) as Date_Floor_Timestamp#,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;date(floor(date#(InsCardEffectiveDate, 'M/D/YYYY hh:mm:ss tt'))) as Date_Floor_Date#&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;FROM [lib://files/Ins.qvd](qvd);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 13:32:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-function-weirdness-during-load/m-p/1779758#M60629</guid>
      <dc:creator>Lauri</dc:creator>
      <dc:date>2021-02-03T13:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Date# function weirdness during load</title>
      <link>https://community.qlik.com/t5/App-Development/Date-function-weirdness-during-load/m-p/1779832#M60633</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/16128"&gt;@Lauri&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The InsCardEffectiveDate field is in timestamp format by default, so you don't need to use Data # and Timestamp #, these functions are used to convert a field in a text string to a date or timestamp field, only use Date and timestamp.&lt;/P&gt;&lt;P&gt;Now, regarding the problem you have when using FIRST, it may be forcing something from behind but, normally, it will not give you results if you use date # and timestamp # on a field that is not a text string. I tried it in April 2019 but I have no problems.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Joseph Morales&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 15:14:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-function-weirdness-during-load/m-p/1779832#M60633</guid>
      <dc:creator>JosephMorales</dc:creator>
      <dc:date>2021-02-03T15:14:31Z</dc:date>
    </item>
  </channel>
</rss>

