<?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: Different date formats from different source files in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Different-date-formats-from-different-source-files/m-p/981050#M644040</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear swuehl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what if I am loading both (or more) tables in one step?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[Data\Dates*.txt]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I assure, that the date format for all tables is the right one?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Olga&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Dec 2015 16:33:45 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-12-11T16:33:45Z</dc:date>
    <item>
      <title>Different date formats from different source files</title>
      <link>https://community.qlik.com/t5/QlikView/Different-date-formats-from-different-source-files/m-p/981047#M644037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Qlik Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am a bit confused regarding the alt function. I have the following two text files:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dates1.txt contains Dates with the format DD/MM/YYYY:&lt;/P&gt;&lt;P&gt;Date&lt;/P&gt;&lt;P&gt;01/01/2015&lt;/P&gt;&lt;P&gt;12/01/2015&lt;/P&gt;&lt;P&gt;21/01/2015&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dates2.txt contains dates with the format MM/DD/YYYY:&lt;/P&gt;&lt;P&gt;Date&lt;/P&gt;&lt;P&gt;04/23/1984&lt;/P&gt;&lt;P&gt;03/06/1984&lt;/P&gt;&lt;P&gt;03/10/1984&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When using the alt function, it seems that QlikView is not able to interpret the different date formats correctly. The list box with the field "Date" shows:&lt;/P&gt;&lt;P&gt;06.03.84&lt;/P&gt;&lt;P&gt;10.03.84&lt;/P&gt;&lt;P&gt;23.04.84&lt;/P&gt;&lt;P&gt;01.01.15&lt;/P&gt;&lt;P&gt;21.01.15&lt;/P&gt;&lt;P&gt;01.12.15&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The last entry should be 12.01.15. What am I missing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know, I can format the Dates separately in the code when loading the text files. But is there a way to use the alt function when loading the "DATA_WITH_ALT" table (see attachment) and get the right results?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Olga&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Dec 2015 12:53:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Different-date-formats-from-different-source-files/m-p/981047#M644037</guid>
      <dc:creator />
      <dc:date>2015-12-09T12:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: Different date formats from different source files</title>
      <link>https://community.qlik.com/t5/QlikView/Different-date-formats-from-different-source-files/m-p/981048#M644038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Alt() function tries to evaluate the arguments and check on numeric return in order of appearance, so if you try&lt;/P&gt;&lt;P&gt;MM/DD/YYYY format first, 12/01/2015 will match this format and will be interpreted as Dec 1st.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you know the format per file, use an explicite date format parsing per file instead.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Dec 2015 19:39:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Different-date-formats-from-different-source-files/m-p/981048#M644038</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-12-09T19:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: Different date formats from different source files</title>
      <link>https://community.qlik.com/t5/QlikView/Different-date-formats-from-different-source-files/m-p/981049#M644039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14496906075275769 jive_text_macro" jivemacro_uid="_14496906075275769"&gt;
&lt;P&gt;DATA.tmp:&lt;/P&gt;
&lt;P&gt;LOAD Date#(Date,'DD/MM/YYYY') as Date&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;[Data\Dates1.txt]&lt;/P&gt;
&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is '\t', msq);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LOAD Date#(Date,'MM/DD/YYYY') as Date&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;[Data\Dates2.txt]&lt;/P&gt;
&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is '\t', msq);&lt;/P&gt;
&lt;P&gt;//&lt;/P&gt;
&lt;P&gt;//DATA_WITH_ALT:&lt;/P&gt;
&lt;P&gt;//NoConcatenate LOAD&lt;/P&gt;
&lt;P&gt;// Date(ALT(Date#(Date,'MM/DD/YYYY'),Date#(Date,'DD/MM/YYYY'),'No valid date')) as Date_ALT&lt;/P&gt;
&lt;P&gt;//RESIDENT DATA.tmp;&lt;/P&gt;
&lt;P&gt;//&lt;/P&gt;
&lt;P&gt;//DROP Table DATA.tmp;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Dec 2015 19:50:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Different-date-formats-from-different-source-files/m-p/981049#M644039</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-12-09T19:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Different date formats from different source files</title>
      <link>https://community.qlik.com/t5/QlikView/Different-date-formats-from-different-source-files/m-p/981050#M644040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear swuehl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what if I am loading both (or more) tables in one step?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[Data\Dates*.txt]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I assure, that the date format for all tables is the right one?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Olga&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 16:33:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Different-date-formats-from-different-source-files/m-p/981050#M644040</guid>
      <dc:creator />
      <dc:date>2015-12-11T16:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: Different date formats from different source files</title>
      <link>https://community.qlik.com/t5/QlikView/Different-date-formats-from-different-source-files/m-p/981051#M644041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Olga,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the problem in your case is that the formats DD/MM/YYYY and MM/DD/YYYY are ambiguous in cases where day of month and month numbers both are &amp;lt;= 12. You can't tell then if 01/12/2015 is Dec 1st or Jan 12th.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the formats would be unambiguous for all possible values, like when using distinct separators, you could use ALT() function, for example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ALT( DATE#( DateField, 'MM/DD/YYYY'), DATE#(DateField, 'DD.MM.YYYY'), 'no valid date') as DateField&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[Data\Dates*.txt];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Dec 2015 22:47:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Different-date-formats-from-different-source-files/m-p/981051#M644041</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-12-13T22:47:11Z</dc:date>
    </item>
  </channel>
</rss>

