<?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 giving incorrect year in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-format-giving-incorrect-year/m-p/1016216#M344321</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In addition to the suggestion from Sunny you might need a further condition to differenciate between 1900 and 2000 like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= if(mid(391107, 1, 2) &amp;lt;= mid(year(today()), 3, 2), 20, 19)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the assumption that 19 might not always correct (but you can't avoid with this format all inaccuracies).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Mar 2016 11:55:01 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2016-03-07T11:55:01Z</dc:date>
    <item>
      <title>Date format giving incorrect year</title>
      <link>https://community.qlik.com/t5/QlikView/Date-format-giving-incorrect-year/m-p/1016214#M344319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have date of births in the following format (I.e. YYMMDD):&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;DOB&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;391107&lt;/P&gt;&lt;P&gt;600116&lt;/P&gt;&lt;P&gt;801008&lt;/P&gt;&lt;P&gt;...etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've used the following in my script editor to create a date formatted field:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;Date&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Date#&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;DOB&lt;/SPAN&gt;, 'YYMMDD'), 'DD/MM/YYYY') &lt;SPAN style="color: #0000ff;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;DOB_FORMATTED&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;My output is showing as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; text-decoration: underline;"&gt;DOB_FORMATTED&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;07/11/2039&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;16/01/2060&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;08/10/2080&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;...etc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;I would like it to show as per below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;07/11/&lt;SPAN style="color: #ff0000;"&gt;19&lt;/SPAN&gt;39&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;16/01/&lt;SPAN style="color: #ff0000;"&gt;19&lt;/SPAN&gt;60&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;08/10/&lt;SPAN style="color: #ff0000;"&gt;19&lt;/SPAN&gt;80&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;...etc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;How can I achieve this?&lt;/SPAN&gt;&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>Mon, 07 Mar 2016 10:04:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-format-giving-incorrect-year/m-p/1016214#M344319</guid>
      <dc:creator />
      <dc:date>2016-03-07T10:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Date format giving incorrect year</title>
      <link>https://community.qlik.com/t5/QlikView/Date-format-giving-incorrect-year/m-p/1016215#M344320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this may be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt; color: #575757;"&gt;(Date#(&lt;SPAN style="color: #ff0000;"&gt;19 &amp;amp;&lt;/SPAN&gt; DOB, '&lt;SPAN style="color: #ff0000;"&gt;YY&lt;/SPAN&gt;YYMMDD'), 'DD/MM/YYYY') as &lt;/SPAN&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;DOB_FORMATTED&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2016 10:43:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-format-giving-incorrect-year/m-p/1016215#M344320</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-03-07T10:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: Date format giving incorrect year</title>
      <link>https://community.qlik.com/t5/QlikView/Date-format-giving-incorrect-year/m-p/1016216#M344321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In addition to the suggestion from Sunny you might need a further condition to differenciate between 1900 and 2000 like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= if(mid(391107, 1, 2) &amp;lt;= mid(year(today()), 3, 2), 20, 19)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the assumption that 19 might not always correct (but you can't avoid with this format all inaccuracies).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2016 11:55:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-format-giving-incorrect-year/m-p/1016216#M344321</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-03-07T11:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Date format giving incorrect year</title>
      <link>https://community.qlik.com/t5/QlikView/Date-format-giving-incorrect-year/m-p/1016217#M344322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with Marcus.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your data is just not well defined, i.e. you can't tell from the data which century you should take.&lt;/P&gt;&lt;P&gt;If you are looking at DOB for turtles, maybe also 19th century (like 1855) might be a valid one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QlikView will just assume that the Year is in a range +-50 years from today (so I don't think it will return 2080 with your sample data).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can make some assumptions (humans, no DOB in the future, not older than 100 years), then go with something like Marcus suggested.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But there probably will be cases where your assumptions fail. So look out for some additional information that helps you retrieve the correct century.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2016 12:17:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-format-giving-incorrect-year/m-p/1016217#M344322</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-03-07T12:17:01Z</dc:date>
    </item>
  </channel>
</rss>

