<?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 Manipulating Timestamps in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Manipulating-Timestamps/m-p/610874#M225467</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 having a bit of trouble calculating a "period" field based on two timestamps: a reference time stamp for the end of a period and the time stamp of an event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join(AttComp_Imp)&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,if([Elapsed Time]&amp;lt;[Period 1 End],1&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,if([Elapsed Time]&amp;lt;[Period 2 End],2&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,if([Elapsed Time]&amp;lt;[Period 3 End],3&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,if([Elapsed Time]&amp;lt;[Period 4 End],4&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,if([Elapsed Time]&amp;lt;[Period 5 End],5&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,if([Elapsed Time]&amp;lt;[Period 6 End],6&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,if([Elapsed Time]&amp;lt;[Period 7 End],7&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,8)&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;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; ) As [Match Period]&lt;/P&gt;&lt;P&gt;Resident AttComp_Imp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The resulting values are all null - and have been when I have tried with Time(), Time#(), Timestamp() and Timestamp#() around the individual elements and the calculation as a whole.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a chart table, the calculations work. I need to do the calculation in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;CS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Apr 2014 11:45:24 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-04-23T11:45:24Z</dc:date>
    <item>
      <title>Manipulating Timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Manipulating-Timestamps/m-p/610874#M225467</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 having a bit of trouble calculating a "period" field based on two timestamps: a reference time stamp for the end of a period and the time stamp of an event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join(AttComp_Imp)&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,if([Elapsed Time]&amp;lt;[Period 1 End],1&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,if([Elapsed Time]&amp;lt;[Period 2 End],2&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,if([Elapsed Time]&amp;lt;[Period 3 End],3&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,if([Elapsed Time]&amp;lt;[Period 4 End],4&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,if([Elapsed Time]&amp;lt;[Period 5 End],5&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,if([Elapsed Time]&amp;lt;[Period 6 End],6&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,if([Elapsed Time]&amp;lt;[Period 7 End],7&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,8)&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;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; ) As [Match Period]&lt;/P&gt;&lt;P&gt;Resident AttComp_Imp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The resulting values are all null - and have been when I have tried with Time(), Time#(), Timestamp() and Timestamp#() around the individual elements and the calculation as a whole.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a chart table, the calculations work. I need to do the calculation in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;CS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 11:45:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Manipulating-Timestamps/m-p/610874#M225467</guid>
      <dc:creator />
      <dc:date>2014-04-23T11:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Manipulating Timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Manipulating-Timestamps/m-p/610875#M225468</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;It seems that you Time and Period fields are just text and should be converted to dates with # function.&lt;/P&gt;&lt;P&gt;*#() functions convert text into date while others just change the text format of date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Post the source data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 12:39:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Manipulating-Timestamps/m-p/610875#M225468</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2014-04-23T12:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: Manipulating Timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Manipulating-Timestamps/m-p/610876#M225469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Source data cannot be provided but it comes from an excel which is timestamp format.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 12:45:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Manipulating-Timestamps/m-p/610876#M225469</guid>
      <dc:creator />
      <dc:date>2014-04-23T12:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Manipulating Timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Manipulating-Timestamps/m-p/610877#M225470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table 1:&lt;/P&gt;&lt;P&gt;Event, Time&lt;/P&gt;&lt;P&gt;1, 00:10:02&lt;/P&gt;&lt;P&gt;2, 00:57:13&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table 2:&lt;/P&gt;&lt;P&gt;Period, End Time&lt;/P&gt;&lt;P&gt;1, 00:15:00&lt;/P&gt;&lt;P&gt;2, 00:45:00&lt;/P&gt;&lt;P&gt;3, 01:00:00&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 13:01:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Manipulating-Timestamps/m-p/610877#M225470</guid>
      <dc:creator />
      <dc:date>2014-04-23T13:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Manipulating Timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Manipulating-Timestamps/m-p/610878#M225471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using Interval()&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 13:10:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Manipulating-Timestamps/m-p/610878#M225471</guid>
      <dc:creator />
      <dc:date>2014-04-23T13:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Manipulating Timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Manipulating-Timestamps/m-p/610879#M225472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried &lt;/P&gt;&lt;P&gt;Interval(Time([Elapsed Time])-Time([Period 1 End]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And &lt;/P&gt;&lt;P&gt;Interval([Elapsed Time]-[Period 1 End])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and both return null values when used in the script (they both work in charts).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have declared the fields as Time() on import as well. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 13:16:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Manipulating-Timestamps/m-p/610879#M225472</guid>
      <dc:creator />
      <dc:date>2014-04-23T13:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Manipulating Timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Manipulating-Timestamps/m-p/610880#M225473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;easiest way to deal with it would be to convert them to numbers to achieve what you are after Callum&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 13:21:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Manipulating-Timestamps/m-p/610880#M225473</guid>
      <dc:creator />
      <dc:date>2014-04-23T13:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Manipulating Timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Manipulating-Timestamps/m-p/610881#M225474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;So the Time values are just strings.&lt;/P&gt;&lt;P&gt;Use something like Time&lt;STRONG&gt;#&lt;/STRONG&gt;([End Time], 'hh:mm:ss') to convert the strings into timestamps to be able to compare them with &amp;lt;&amp;gt;.&lt;/P&gt;&lt;P&gt;Again, Time() changes the text &lt;STRONG&gt;format &lt;/STRONG&gt;of&lt;STRONG&gt; &lt;/STRONG&gt;dual value (both number and text)&lt;STRONG&gt;,&amp;nbsp; &lt;/STRONG&gt;while Time#() converts the string into timestamps (dual).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 18:03:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Manipulating-Timestamps/m-p/610881#M225474</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2014-04-23T18:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Manipulating Timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Manipulating-Timestamps/m-p/610882#M225475</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 built a sample application. Please have a look.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Darius&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 18:33:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Manipulating-Timestamps/m-p/610882#M225475</guid>
      <dc:creator>d_pranskus</dc:creator>
      <dc:date>2014-04-23T18:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Manipulating Timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Manipulating-Timestamps/m-p/610883#M225476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks all for your comments and help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Darius, the solution used in the example has worked perfectly. Thanks very much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 15:41:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Manipulating-Timestamps/m-p/610883#M225476</guid>
      <dc:creator />
      <dc:date>2014-04-24T15:41:41Z</dc:date>
    </item>
  </channel>
</rss>

