<?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: Timestamp function always returning null in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Timestamp-function-always-returning-null/m-p/1264968#M25871</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Two things&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) I don't see .fff in your TimeStamp#() function&lt;/P&gt;&lt;P&gt;2) I see you have used HH:MM:SS at some places... the problem is that M is used for Months and m is used for minutes. I think replace HH:MM:SS with hh:mm:ss&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/146712_Capture.PNG" style="height: 72px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Dec 2016 22:59:15 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-12-14T22:59:15Z</dc:date>
    <item>
      <title>Timestamp function always returning null</title>
      <link>https://community.qlik.com/t5/App-Development/Timestamp-function-always-returning-null/m-p/1264965#M25868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm having the usually difficultly with timestamps in QlikSense, being generally difficult to sort, filter and display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have timestamps stored in the database as e.g.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;2016-12-13 22:59:09.235&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm loading them (snippet below) and trying to format them for display.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;raised_time,&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Timestamp#(raised_time,'YYYY-MM-DD hh:mm:ss.fff') as raisedTimestamp,&lt;/P&gt;&lt;P&gt;Timestamp(Timestamp#(raised_time,'YYYY-MM-DD hh:mm:ss.fff'),'DD-MM-YYYY hh:mm:ss') as formattedTimestamp,&lt;/P&gt;&lt;P&gt;Timestamp(42716.356185243,'YY-MM-DD hh:mm:ss') as hardcoded_42716.356185243&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I put these values into a table, raisedTimestamp is displayed as a number (e.g. &lt;SPAN style="font-size: 13.3333px;"&gt;42716.356185243), the hard-coded value displays as expected (12-12-2016 08:32:54) but the field I actually want, formattedTimestamp, is always null.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea what I'm doing wrong? All the other posts seems to imply this is easy!&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2016 22:17:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Timestamp-function-always-returning-null/m-p/1264965#M25868</guid>
      <dc:creator />
      <dc:date>2016-12-14T22:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp function always returning null</title>
      <link>https://community.qlik.com/t5/App-Development/Timestamp-function-always-returning-null/m-p/1264966#M25869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to share you file or images of the front end and script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2016 22:22:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Timestamp-function-always-returning-null/m-p/1264966#M25869</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-14T22:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp function always returning null</title>
      <link>https://community.qlik.com/t5/App-Development/Timestamp-function-always-returning-null/m-p/1264967#M25870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yep, sorry, pretty new to this. Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's a mystery as the values returned by Timestamp# appear fine, and when I hard code one of the values into the Timestamp function all seems well. However a hard coded string also fails to convert correctly.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="alert-table.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/146708_alert-table.PNG" style="height: 203px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="alert-script.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/146709_alert-script.PNG" style="height: 310px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Lee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2016 22:37:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Timestamp-function-always-returning-null/m-p/1264967#M25870</guid>
      <dc:creator />
      <dc:date>2016-12-14T22:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp function always returning null</title>
      <link>https://community.qlik.com/t5/App-Development/Timestamp-function-always-returning-null/m-p/1264968#M25871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Two things&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) I don't see .fff in your TimeStamp#() function&lt;/P&gt;&lt;P&gt;2) I see you have used HH:MM:SS at some places... the problem is that M is used for Months and m is used for minutes. I think replace HH:MM:SS with hh:mm:ss&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/146712_Capture.PNG" style="height: 72px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2016 22:59:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Timestamp-function-always-returning-null/m-p/1264968#M25871</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-14T22:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp function always returning null</title>
      <link>https://community.qlik.com/t5/App-Development/Timestamp-function-always-returning-null/m-p/1264969#M25872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You're right, I've been trying many combinations so see if I hit on the right one. I've tidied things up to try and illustrate the issue which still remains.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The raw raised time appears to have three trailing zeros, so I load it with ".ffffff" at the end.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Timestamp#(raised_time,'YYYY-MM-DD hh:mm:ss.ffffff') as raisedTimestamp&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This converts to a timestamp OK with numeric value 42716.356185243. However when I try and format this for display &lt;EM&gt;null is always returned&lt;/EM&gt;:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;Timestamp(Timestamp#(raised_time,'YYYY-MM-DD hh:mm:ss.ffffff'),'DD-MM-YYYY hh:mm:ss') as formattedTimestamp&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I hard code the numeric value into a timestamp function it formats OK:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Timestamp(42716.356185243,'DD-MM-YYYY hh:mm:ss') as hardcoded_42716.356185243&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, I hard coded the raw string value of &lt;SPAN style="font-size: 13.3333px;"&gt;raised_time into the functions and they both convert and format fine:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;Timestamp#('2016-12-12 08:32:54.405000','YYYY-MM-DD hh:mm:ss.ffffff') as hardcodedTimestamp,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Timestamp(Timestamp#('2016-12-12 08:32:54.405000','YYYY-MM-DD hh:mm:ss.ffffff'),'DD-MM-YYYY hh:mm:ss') as formattedHardcodedTimestamp&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So this has got me very confused. How can both timestamp functions process the hard coded values, but when using an actual field it fails? This can't be a bug - I'm missing something!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The screenshot below shows the output.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="alert-hardcoded.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/146736_alert-hardcoded.PNG" style="height: 53px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2016 09:01:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Timestamp-function-always-returning-null/m-p/1264969#M25872</guid>
      <dc:creator />
      <dc:date>2016-12-15T09:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp function always returning null</title>
      <link>https://community.qlik.com/t5/App-Development/Timestamp-function-always-returning-null/m-p/1264970#M25873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looking at my last reply, I've noticed something else:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The Timestamp# is meant to interpret a string as a timestamp, but keep the original text:&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Timestamp#('2016-12-12 08:32:54.405000','YYYY-MM-DD hh:mm:ss.ffffff') as hardcodedTimestamp&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It does this: hardcodedTimestamp appears as '2016-12-12 08:32:54.405000' in the table. It's obviously been translated as a timestamp, as I can reformat it fine as formattedHardcodedTimestamp and it displays '12-12-2016 08:32:54'.&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;However, when I use &lt;SPAN style="font-size: 13.3333px;"&gt;Timestamp# on the loaded field raised_time and display it, the original text is not retained. The numerical value that should be behind the timestamp, 42716.356185243, is displayed instead. I'd have expected the raw string value of raised_time. Am I right here? If so, this tells me that the &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Timestamp# function has failed to interpret raised_time - But is somehow still parsing it as a timestamp and storing the numerical value.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Confused.&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2016 09:24:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Timestamp-function-always-returning-null/m-p/1264970#M25873</guid>
      <dc:creator />
      <dc:date>2016-12-15T09:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp function always returning null</title>
      <link>https://community.qlik.com/t5/App-Development/Timestamp-function-always-returning-null/m-p/1264971#M25874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From this image, it seems that raised time is already interpreted correctly by Qlik Sense and you might not really need to use TimeStamp#() function. Can you just try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;TimeStamp(raised_time,'&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;DD-MM-YYYY hh:mm:ss&lt;/SPAN&gt;') as raisedTimestamp&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2016 10:00:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Timestamp-function-always-returning-null/m-p/1264971#M25874</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-15T10:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp function always returning null</title>
      <link>https://community.qlik.com/t5/App-Development/Timestamp-function-always-returning-null/m-p/1264972#M25875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you're right - Thanks for sticking with me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wasn't sure, as when I load in the same date/time data via excel (the values are stored as e.g. "&lt;STRONG&gt;13/12/2016 11:36:51&lt;/STRONG&gt;"), Qlik is automatically spotting this is a date/time and expanding this in the "Fields" pane:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="autocalendar.PNG" class="jive-image image-1" height="169" src="https://community.qlik.com/legacyfs/online/146753_autocalendar.PNG" style="height: 169.084px; width: 224px;" width="224" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This isn't happening when loaded directly from the database where there is the milliseconds component. I've followed many threads where, in the end, everyone gives up and either changes the SQL that loads the data or changes the application that writes the data. I have control of both so will solve there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2016 10:35:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Timestamp-function-always-returning-null/m-p/1264972#M25875</guid>
      <dc:creator />
      <dc:date>2016-12-15T10:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp function always returning null</title>
      <link>https://community.qlik.com/t5/App-Development/Timestamp-function-always-returning-null/m-p/1264973#M25876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds good &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2016 10:53:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Timestamp-function-always-returning-null/m-p/1264973#M25876</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-15T10:53:46Z</dc:date>
    </item>
  </channel>
</rss>

