<?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: Difference dates to num in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Difference-dates-to-num/m-p/341142#M126048</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry about that. The file is updated now. I was checking the data base and the data base administrator told me that end month is not a field. So I create at end month variable but I can't still get the good result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Jul 2012 18:55:07 GMT</pubDate>
    <dc:creator>pgalvezt</dc:creator>
    <dc:date>2012-07-09T18:55:07Z</dc:date>
    <item>
      <title>Difference dates to num</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-dates-to-num/m-p/341137#M126043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, Currently I have worked with Visual Fox Pro until now the model goes well, but I have a new requiriment and I couldn't figure out the idea is obtain in num from different dates. anybody knows how to obtain this I tried by script but nothing happened. The other thing is the database return me a wire date like: &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;&amp;nbsp; 00/01/1900 &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;is there anyway to delete this date?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2012 13:55:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-dates-to-num/m-p/341137#M126043</guid>
      <dc:creator>pgalvezt</dc:creator>
      <dc:date>2012-07-09T13:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Difference dates to num</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-dates-to-num/m-p/341138#M126044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I haven't fully understood your problem, but in general&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a) interpret your dates using date#() function or a standard date format when loading, so your dates have an internal numerical representation within QV. Then just subtract the dates to get the difference in days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b) 00/01/1900 is surely no date. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In what format do you get your dates returned from the DB? Are you using some kind of date interpretation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should get false (0) returned if you try to apply isnum() to a date interpretation like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;isnum(date#('00/01/1900','DD/MM/YYYY')) as IsDateFlag&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2012 14:37:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-dates-to-num/m-p/341138#M126044</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-07-09T14:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Difference dates to num</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-dates-to-num/m-p/341139#M126045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi stefan thank you for your reply. I forgot tell you that my format dates are different End Month and Expiration Oldest I need the result between End Month - Expiration Oldest but the second date appear like "-". I attached a file qvw for better comprehension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2012 16:09:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-dates-to-num/m-p/341139#M126045</guid>
      <dc:creator>pgalvezt</dc:creator>
      <dc:date>2012-07-09T16:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: Difference dates to num</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-dates-to-num/m-p/341140#M126046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi stefan thank you for your reply. I forgot tell you that my format dates are different End Month and Expiration Oldest I need the result between End Month - Expiration Oldest but the second date appear like "-". I attached a file qvw for better comprehension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2012 17:30:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-dates-to-num/m-p/341140#M126046</guid>
      <dc:creator>pgalvezt</dc:creator>
      <dc:date>2012-07-09T17:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Difference dates to num</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-dates-to-num/m-p/341141#M126047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I am not going to download your 22 MB file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But looking at your first sample, you could try something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SET ThousandSep='.';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SET DecimalSep=',';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SET MoneyThousandSep='.';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SET MoneyDecimalSep=',';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SET MoneyFormat='#.##0,00 €;-#.##0,00 €';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SET TimeFormat='h:mm:ss';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SET DateFormat='DD/MM/YYYY';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SET TimestampFormat='DD/MM/YYYY h:mm:ss[.fff]';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SET MonthNames='ene;feb;mar;abr;may;jun;jul;ago;sep;oct;nov;dic';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SET DayNames='lun;mar;mié;jue;vie;sáb;dom';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD *, Date1-Date2 as Diff;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Load&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; Date1,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(isnum(Date#(Date2,'DD-MMM-YY')),&lt;EM&gt;Date#(Date2,'DD-MMM-YY')&lt;/EM&gt;) as Date2 &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Inline [Date1, Date2&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;01/05/2012,00/01/1900&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;10/05/2012,05-dic-10&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;20/05/2012,05-ene-11];&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2012 18:40:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-dates-to-num/m-p/341141#M126047</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-07-09T18:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Difference dates to num</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-dates-to-num/m-p/341142#M126048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry about that. The file is updated now. I was checking the data base and the data base administrator told me that end month is not a field. So I create at end month variable but I can't still get the good result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2012 18:55:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-dates-to-num/m-p/341142#M126048</guid>
      <dc:creator>pgalvezt</dc:creator>
      <dc:date>2012-07-09T18:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Difference dates to num</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-dates-to-num/m-p/341143#M126049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if I understand what your problem is, but I think one issue is still not matching date formats.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your standard date format is defined by&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET DateFormat='DD-MM-YYYY';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the format of e.g. TD_Corte is like 'DD/MM/YYYY' (e.g. 20/05/2012), so it is not interpreted correctly as date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;date#(td_corte,'DD/MM/YYYY') as TD_Corte,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;date(date#(td_corte,'DD/MM/YYYY')) as TD_Corte,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to correctly interpret your date and then maybe format it according your standard date format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest that you check out the date# / date resp. timestamp# / timestamp functions and the date and time format codes in the Help (there is also a heap of samples in thousands of threads here in the forum related to your issue).&lt;/P&gt;&lt;P&gt;A good summary has been done by Henric Cronström:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="loading" href="https://community.qlik.com/blogs/qlikviewdesignblog/2012/06/08/get-the-dates-right"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2012/06/08/get-the-dates-right&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="loading" href="https://community.qlik.com/docs/DOC-3102"&gt;http://community.qlik.com/docs/DOC-3102&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2012 20:06:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-dates-to-num/m-p/341143#M126049</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-07-09T20:06:13Z</dc:date>
    </item>
  </channel>
</rss>

