<?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: Date format problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-format-problem/m-p/251905#M1194858</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can’t seem to reply to threads – javascript: void(0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this works. Thank you Erich, that works. Is there any way to limit the field to 1 or 2 decimals – it currently shows about 15. So one hour and a few seconds will show as 1.0000000000000164.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I would like to change the process time to show either less than an hour, or 1 – 2 hours, 2 – 3 hours, or more than 3 hours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help. This is my script currently:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Timestamp(Timestamp#( &lt;A href="Log Date"&gt;&lt;/A&gt;, 'DD-MMM-YYYY hh:mm:ss')) as &lt;A href="Log Date"&gt;&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;     Timestamp(Timestamp#( &lt;A href="Decision Date"&gt;&lt;/A&gt;, 'DD-MMM-YYYY hh:mm:ss')) as &lt;A href="Decision Date"&gt;&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;     Timestamp( Timestamp#(&lt;A href="Decision Date"&gt;&lt;/A&gt;, 'DD-MMM-YYYY hh:mm:ss') - Timestamp(Timestamp#( &lt;A href="Log Date"&gt;&lt;/A&gt;, 'DD-MMM-YYYY hh:mm:ss') )) * 24 as &lt;A href="Process Time"&gt;&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gerhard Laubscher&lt;/P&gt;&lt;P&gt;Tenacity (a Pepkor company)&lt;/P&gt;&lt;P&gt;P.O. Box 6387, Parow East, 7501, South Africa&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T: +27 (0)21 928 1017&lt;/P&gt;&lt;P&gt;F: +27 (0)21 928 1012&lt;/P&gt;&lt;P&gt;C: +27 (0)82 080 4190&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;www.tenacityinc.co.za&amp;lt;http://www.tenacityinc.co.za/&amp;gt;&lt;/P&gt;&lt;P&gt;gerhardl@tenacityinc.co.za&amp;lt;mailto:stephnik@tenacityinc.co.za&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 May 2011 14:56:56 GMT</pubDate>
    <dc:creator>gerhardl</dc:creator>
    <dc:date>2011-05-30T14:56:56Z</dc:date>
    <item>
      <title>Date format problem</title>
      <link>https://community.qlik.com/t5/QlikView/Date-format-problem/m-p/251902#M1194855</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 help with a script that is already doing my head in. I use application extract with the following two fields:&lt;/P&gt;&lt;P&gt;[Log Date]&lt;/P&gt;&lt;P&gt;[Decision Date]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both are in the following format (in a delimited text file):&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;27-MAY-2011 14:46:28 (i.e. DD-MMM-YYYY hh:mm:ss)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Using these 2 fields I determine the process time of an application. At the moment I determine this in DAYS, but I need to do so in hours. Please can someone help me to amend the below script so it takes the hh:mm:ss into consideration and so my [Process Time] field shows in hours:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Date(Date#( left( [Log Date],11), 'DD-MMM-YYYY')) as [Log Date], &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(Date#( left( [Decision Date],11), 'DD-MMM-YYYY')) as [Decision Date],&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; weekday(Date(Date#( left( [Decision Date],11), 'DD-MMM-YYYY'))) as [Decision Day], &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; month(Date(Date#( left( [Decision Date],11), 'DD-MMM-YYYY'))) as [Decision Month], &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; year(Date(Date#( left( [Decision Date],11), 'DD-MMM-YYYY'))) as [Decision Year], &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if([Decicion Result]='A','Approved','Declined') as [Decision Result], &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Date#( left( [Log Date],11), 'DD-MMM-YYYY') =date#( left([Decision Date],11),'DD-MMM-YYYY'), 'Same Day', date#( left([Decision Date],11),'DD-MMM-YYYY')-Date#( left( [Log Date],11), 'DD-MMM-YYYY')) as [Process Time],&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gerhard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 14:21:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-format-problem/m-p/251902#M1194855</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2011-05-30T14:21:12Z</dc:date>
    </item>
    <item>
      <title>Date format problem</title>
      <link>https://community.qlik.com/t5/QlikView/Date-format-problem/m-p/251903#M1194856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gerhardl&lt;/P&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; if(Date#([Log Date], 'DD-MMM-YYYY hh:mm:ss') =date#([Decision Date],'DD-MMM-YYYY hh:mm:ss'), 'Same Time', date#([Decision Date],'DD-MMM-YYYY hh:mm:ss')-Date#([Log Date], 'DD-MMM-YYYY hh:mm:ss') as [Process Time],&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 14:48:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-format-problem/m-p/251903#M1194856</guid>
      <dc:creator />
      <dc:date>2011-05-30T14:48:00Z</dc:date>
    </item>
    <item>
      <title>Date format problem</title>
      <link>https://community.qlik.com/t5/QlikView/Date-format-problem/m-p/251904#M1194857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this: &lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;( Timestamp#(&lt;/STRONG&gt;&lt;STRONG&gt;[Decision Date]&lt;/STRONG&gt;&lt;STRONG&gt;, 'DD-MMM-YYYY hh:mm:ss') - &lt;BR /&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Timestamp#( [Log Date], '&lt;/STRONG&gt;&lt;STRONG&gt;DD-MMM-YYYY hh:mm:ss'&lt;/STRONG&gt;&lt;STRONG&gt;) ) * 24 as [Process Time]&amp;nbsp; // in Hours&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The timestamp will evaluate your string as date+time&lt;/P&gt;&lt;P&gt;The difference between two timestamps will be a difference in days including fractions for hours. &lt;/P&gt;&lt;P&gt;So, if you get 12.5, this means 12 days and half day or 12 days and 12 hours. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I multiplied by 24 to get the result in hours. So, for 12.5 you should get 300 hours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 14:49:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-format-problem/m-p/251904#M1194857</guid>
      <dc:creator>erichshiino</dc:creator>
      <dc:date>2011-05-30T14:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Date format problem</title>
      <link>https://community.qlik.com/t5/QlikView/Date-format-problem/m-p/251905#M1194858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can’t seem to reply to threads – javascript: void(0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this works. Thank you Erich, that works. Is there any way to limit the field to 1 or 2 decimals – it currently shows about 15. So one hour and a few seconds will show as 1.0000000000000164.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I would like to change the process time to show either less than an hour, or 1 – 2 hours, 2 – 3 hours, or more than 3 hours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help. This is my script currently:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Timestamp(Timestamp#( &lt;A href="Log Date"&gt;&lt;/A&gt;, 'DD-MMM-YYYY hh:mm:ss')) as &lt;A href="Log Date"&gt;&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;     Timestamp(Timestamp#( &lt;A href="Decision Date"&gt;&lt;/A&gt;, 'DD-MMM-YYYY hh:mm:ss')) as &lt;A href="Decision Date"&gt;&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;     Timestamp( Timestamp#(&lt;A href="Decision Date"&gt;&lt;/A&gt;, 'DD-MMM-YYYY hh:mm:ss') - Timestamp(Timestamp#( &lt;A href="Log Date"&gt;&lt;/A&gt;, 'DD-MMM-YYYY hh:mm:ss') )) * 24 as &lt;A href="Process Time"&gt;&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gerhard Laubscher&lt;/P&gt;&lt;P&gt;Tenacity (a Pepkor company)&lt;/P&gt;&lt;P&gt;P.O. Box 6387, Parow East, 7501, South Africa&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T: +27 (0)21 928 1017&lt;/P&gt;&lt;P&gt;F: +27 (0)21 928 1012&lt;/P&gt;&lt;P&gt;C: +27 (0)82 080 4190&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;www.tenacityinc.co.za&amp;lt;http://www.tenacityinc.co.za/&amp;gt;&lt;/P&gt;&lt;P&gt;gerhardl@tenacityinc.co.za&amp;lt;mailto:stephnik@tenacityinc.co.za&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 14:56:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-format-problem/m-p/251905#M1194858</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2011-05-30T14:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: Date format problem</title>
      <link>https://community.qlik.com/t5/QlikView/Date-format-problem/m-p/251906#M1194859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can adjust the presentation of the field in Settings -&amp;gt; Document Properties -&amp;gt; Number (it's similar to excel) &lt;/P&gt;&lt;P&gt;You could also force it on script level ( you may need to try some different settings) : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt; num ( ( Timestamp#([Decision Date], 'DD-MMM-YYYY hh:mm:ss') - &lt;BR /&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Timestamp#( [Log Date], 'DD-MMM-YYYY hh:mm:ss') ) * 24, '##0.00') as [Process Time] &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;For the ranges, you could use intervalmatch, but since it's simple, you could just write an if statement: &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;if( &lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;(Timestamp#([Decision Date], 'DD-MMM-YYYY hh:mm:ss') - &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Timestamp#( [Log Date], 'DD-MMM-YYYY hh:mm:ss') ) * 24 &amp;lt;1, 'Less than 1-hour',&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;if( &lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;(Timestamp#([Decision Date], 'DD-MMM-YYYY hh:mm:ss') - &lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Timestamp#( [Log Date], 'DD-MMM-YYYY hh:mm:ss') ) * 24 &amp;lt;2, '1-2 hours',&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;if( &lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;(Timestamp#([Decision Date], 'DD-MMM-YYYY hh:mm:ss') - &lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Timestamp#( [Log Date], 'DD-MMM-YYYY hh:mm:ss') ) * 24 &amp;lt;3, '2-3 hours','3+ Hours'&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope I didn't forget any ( or ) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 15:11:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-format-problem/m-p/251906#M1194859</guid>
      <dc:creator>erichshiino</dc:creator>
      <dc:date>2011-05-30T15:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Date format problem</title>
      <link>https://community.qlik.com/t5/QlikView/Date-format-problem/m-p/251907#M1194860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, works beautifully. The forum does not though. I cannot click on reply, nothing happens, I have to reply to the email notification I get. And I cannot find the “Mark as Answer” that used to be there before the site changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gerhard Laubscher&lt;/P&gt;&lt;P&gt;Tenacity (a Pepkor company)&lt;/P&gt;&lt;P&gt;P.O. Box 6387, Parow East, 7501, South Africa&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T: +27 (0)21 928 1017&lt;/P&gt;&lt;P&gt;F: +27 (0)21 928 1012&lt;/P&gt;&lt;P&gt;C: +27 (0)82 080 4190&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;www.tenacityinc.co.za&amp;lt;http://www.tenacityinc.co.za/&amp;gt;&lt;/P&gt;&lt;P&gt;gerhardl@tenacityinc.co.za&amp;lt;mailto:stephnik@tenacityinc.co.za&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2011 07:57:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-format-problem/m-p/251907#M1194860</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2011-05-31T07:57:39Z</dc:date>
    </item>
  </channel>
</rss>

