<?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 Get numeric value of a timestamp? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Get-numeric-value-of-a-timestamp/m-p/759199#M270146</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;I need to filter a table&lt;/P&gt;&lt;P&gt;- on the date and&lt;/P&gt;&lt;P&gt;- on the time (but only if the date is yesterday)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&amp;gt; That is a bit complex. Doable, certainly - but it would be the easier way to just compare the timestamp (which is in numeric format anyway) to the numeric timestamp of the exact date and time I want to set as cutoff.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&amp;gt; How do I do that?`&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Mar 2015 13:34:06 GMT</pubDate>
    <dc:creator>datanibbler</dc:creator>
    <dc:date>2015-03-20T13:34:06Z</dc:date>
    <item>
      <title>Get numeric value of a timestamp?</title>
      <link>https://community.qlik.com/t5/QlikView/Get-numeric-value-of-a-timestamp/m-p/759199#M270146</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;I need to filter a table&lt;/P&gt;&lt;P&gt;- on the date and&lt;/P&gt;&lt;P&gt;- on the time (but only if the date is yesterday)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&amp;gt; That is a bit complex. Doable, certainly - but it would be the easier way to just compare the timestamp (which is in numeric format anyway) to the numeric timestamp of the exact date and time I want to set as cutoff.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&amp;gt; How do I do that?`&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 13:34:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-numeric-value-of-a-timestamp/m-p/759199#M270146</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2015-03-20T13:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Get numeric value of a timestamp?</title>
      <link>https://community.qlik.com/t5/QlikView/Get-numeric-value-of-a-timestamp/m-p/759200#M270147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, I think I have found out myself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use Makedate() and Maketime() with a BLANK inbetween and put the whole thing into a num() function, I get the numeric value.&lt;/P&gt;&lt;P&gt;It looks quite plausible. Let's see.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 13:41:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-numeric-value-of-a-timestamp/m-p/759200#M270147</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2015-03-20T13:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Get numeric value of a timestamp?</title>
      <link>https://community.qlik.com/t5/QlikView/Get-numeric-value-of-a-timestamp/m-p/759201#M270148</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;Is the cutoff set by one or two variables? Do you mean comparing a timestamp with separate time and date variables? Something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(TimeStampField &amp;lt; (vDate + vTime)), ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming vDate and vTime are normal QV date and time data types. Or, if they are text, then something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(TimeStampField &amp;lt; (Date#(vDate, ....) + Time#(vTime, ....))), ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 13:42:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-numeric-value-of-a-timestamp/m-p/759201#M270148</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-03-20T13:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: Get numeric value of a timestamp?</title>
      <link>https://community.qlik.com/t5/QlikView/Get-numeric-value-of-a-timestamp/m-p/759202#M270149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no. Maybe I explained it badly:&lt;/P&gt;&lt;P&gt;- I have a timestamp in the table in numeric format.&lt;/P&gt;&lt;P&gt;- I just wanted to know how to construct the numeric value (to compare with this) of an exact date and time (that I know, it's not in my table, at least not yet)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 13:47:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-numeric-value-of-a-timestamp/m-p/759202#M270149</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2015-03-20T13:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Get numeric value of a timestamp?</title>
      <link>https://community.qlik.com/t5/QlikView/Get-numeric-value-of-a-timestamp/m-p/759203#M270150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just a warning:&lt;/P&gt;&lt;P&gt;No two timestamps are exactly equal (well, I'm just a little exaggerating).&amp;nbsp; That means, do not use conditions like:&lt;/P&gt;&lt;P&gt;Timestamp1 = Timestamp2.&lt;/P&gt;&lt;P&gt;Using &amp;gt;, &amp;gt;=, &amp;lt;, &amp;lt;= is fine of course.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 13:58:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-numeric-value-of-a-timestamp/m-p/759203#M270150</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-20T13:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Get numeric value of a timestamp?</title>
      <link>https://community.qlik.com/t5/QlikView/Get-numeric-value-of-a-timestamp/m-p/759204#M270151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just add the date and time. The logic I showed you for variables will work for fields as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 14:25:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-numeric-value-of-a-timestamp/m-p/759204#M270151</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-03-20T14:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Get numeric value of a timestamp?</title>
      <link>https://community.qlik.com/t5/QlikView/Get-numeric-value-of-a-timestamp/m-p/759205#M270152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What has been said below should enable you to find a suitable solution already. To give you some insight in the handling of time/date values internally, check this out:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="81412" alt="DateTime Calculations thread156940.jpg" class="image-1 jive-image" src="/legacyfs/online/81412_DateTime Calculations thread156940.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date values are integers, time values are fractions (the part of a full day e.g. 1/4 = 0,25 = 6:00:00). Add them together and you get a timestamp value (whether it will really be a dual() value depends on what exactly you are adding together).&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Comparisons of - and calculations with timestamps, dates and times will always be done numerically, so adding together MakeDate and MakeTime will produce a purely numerical value that can be compared to any timestamp or datetime field from your database. For example, compare this to Jonathans example using variables (assuming that TimeStampField already contains a numerical datetime):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt; font-family: 'courier new', courier;"&gt;IF (TimeStampField &amp;lt; (MakeDate(2015, 3, 20) + MakeTime(4, 0, 0)), TrueValue, FalseValue)...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Best,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Peter&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 15:32:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-numeric-value-of-a-timestamp/m-p/759205#M270152</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-03-20T15:32:06Z</dc:date>
    </item>
  </channel>
</rss>

