<?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: Time range problems in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Time-range-problems/m-p/947945#M645620</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;For your &lt;EM style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Duration_seconds&lt;/EM&gt; try :&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;Time(End_Time) - (Start_Time))&amp;nbsp; * 24&amp;nbsp; * 60 * 60&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM style="color: #000000; font-size: 10pt; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;as Duration_seconds&lt;/EM&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM style="font-size: 10pt; font-family: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;A timestamp is held as the number of days since a certain date ages ago.&amp;nbsp; The integer part of it is the number of days since then and the decimal part is the fraction of a day.&amp;nbsp; It is held as a &lt;EM&gt;dual&lt;/EM&gt; and the text representation is the standard human readable format.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;The '&lt;EM style="color: #000000; font-size: 10pt; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;ss' argument to your interval() &lt;/EM&gt;formats the &lt;EM&gt;dual&lt;/EM&gt; text representation to be human readable seconds, but the dual number part remains as a decimal.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;So to get the number of seconds multiply the decimal by the number of seconds in a day, which is 24*60*60..&lt;/P&gt;&lt;P&gt;&lt;EM style=": ; font-size: 10pt; font-family: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style=": ; font-size: 10pt; font-family: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Dec 2015 18:53:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-12-17T18:53:54Z</dc:date>
    <item>
      <title>Time range problems</title>
      <link>https://community.qlik.com/t5/QlikView/Time-range-problems/m-p/947944#M645619</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 am working on a qvw where I have to display time durations and time ranges.&lt;/P&gt;&lt;P&gt;What I have available in the data source are a Start_Time field and an End_Time field in DD.MM.YYY hh:mm:ss&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far I have successfully&amp;nbsp; created two duration fields by adding this to the script:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;EM&gt;Interval(&lt;/EM&gt;&lt;/SPAN&gt;&lt;EM style="font-size: 10pt;"&gt;Time(End_Time) - (Start_Time),'hh:mm:ss') as Duration&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 10pt;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;Interval(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;Time(End_Time) - (Start_Time),'ss') as Duration_seconds&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;No I want to create a time range field which &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;should show the number of elements in a chart with durations of, let´s say&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;less than 1 hour,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;1-3 hours,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;everything else&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I totally failed with the &lt;EM&gt;Duration&lt;/EM&gt; field, that´s why I created the above &lt;EM&gt;Duration_Seconds&lt;/EM&gt; field as well. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;My last useless effort looks like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if((Duration_seconds)&amp;lt;=3600,'less than 1 hour',&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; if((Duration_seconds)&amp;lt;=10800,'1-3hours', &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; 'everything else')) as Range&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result is that all records fall into the less than 1 hour category, even if they lasted 8.000 seconds or more.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am lost...&lt;/P&gt;&lt;P&gt;Is the seconds field in a wrong format? Can it be converted into numerical? Can it work with the Duration field?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2015 09:42:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-range-problems/m-p/947944#M645619</guid>
      <dc:creator />
      <dc:date>2015-12-17T09:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Time range problems</title>
      <link>https://community.qlik.com/t5/QlikView/Time-range-problems/m-p/947945#M645620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;For your &lt;EM style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Duration_seconds&lt;/EM&gt; try :&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;Time(End_Time) - (Start_Time))&amp;nbsp; * 24&amp;nbsp; * 60 * 60&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM style="color: #000000; font-size: 10pt; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;as Duration_seconds&lt;/EM&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM style="font-size: 10pt; font-family: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;A timestamp is held as the number of days since a certain date ages ago.&amp;nbsp; The integer part of it is the number of days since then and the decimal part is the fraction of a day.&amp;nbsp; It is held as a &lt;EM&gt;dual&lt;/EM&gt; and the text representation is the standard human readable format.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;The '&lt;EM style="color: #000000; font-size: 10pt; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;ss' argument to your interval() &lt;/EM&gt;formats the &lt;EM&gt;dual&lt;/EM&gt; text representation to be human readable seconds, but the dual number part remains as a decimal.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;So to get the number of seconds multiply the decimal by the number of seconds in a day, which is 24*60*60..&lt;/P&gt;&lt;P&gt;&lt;EM style=": ; font-size: 10pt; font-family: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style=": ; font-size: 10pt; font-family: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2015 18:53:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-range-problems/m-p/947945#M645620</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-17T18:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Time range problems</title>
      <link>https://community.qlik.com/t5/QlikView/Time-range-problems/m-p/947946#M645621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bill,&lt;/P&gt;&lt;P&gt;Thank you very much, it works perfectly!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 05:22:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-range-problems/m-p/947946#M645621</guid>
      <dc:creator />
      <dc:date>2015-12-18T05:22:17Z</dc:date>
    </item>
  </channel>
</rss>

