<?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 how to parse various date formats in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/how-to-parse-various-date-formats/m-p/2236217#M25007</link>
    <description>&lt;P&gt;hello community,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;in my csv file i have three different date formats -&amp;gt; (&lt;STRONG&gt;"MM/dd/yyyy", "MM.dd.yyyy", "yyyy"&lt;/STRONG&gt;) as string values.&lt;/P&gt; 
&lt;P&gt;I wanted to use parsedate function in tMap.&lt;/P&gt; 
&lt;P&gt;First i did it like this:&amp;nbsp;TalendDate.parseDate("MM.dd.yyyy",row1.birth_date);&lt;/P&gt; 
&lt;P&gt;and it works for one or more rows when&amp;nbsp;it is only THIS format.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;But as mentioned before I also need&amp;nbsp;&lt;SPAN&gt;TalendDate.parseDate("MM/dd/yyyy",row1.birth_date); and&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;TalendDate.parseDate("yyyy",row1.birth_date);&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;How can I combine these three types?&lt;/STRONG&gt; I tried to use +, &amp;amp;&amp;amp; but it does not work.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Can someone help me out?&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;thanks in advance&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;lisua&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 07:19:43 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T07:19:43Z</dc:date>
    <item>
      <title>how to parse various date formats</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-parse-various-date-formats/m-p/2236217#M25007</link>
      <description>&lt;P&gt;hello community,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;in my csv file i have three different date formats -&amp;gt; (&lt;STRONG&gt;"MM/dd/yyyy", "MM.dd.yyyy", "yyyy"&lt;/STRONG&gt;) as string values.&lt;/P&gt; 
&lt;P&gt;I wanted to use parsedate function in tMap.&lt;/P&gt; 
&lt;P&gt;First i did it like this:&amp;nbsp;TalendDate.parseDate("MM.dd.yyyy",row1.birth_date);&lt;/P&gt; 
&lt;P&gt;and it works for one or more rows when&amp;nbsp;it is only THIS format.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;But as mentioned before I also need&amp;nbsp;&lt;SPAN&gt;TalendDate.parseDate("MM/dd/yyyy",row1.birth_date); and&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;TalendDate.parseDate("yyyy",row1.birth_date);&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;How can I combine these three types?&lt;/STRONG&gt; I tried to use +, &amp;amp;&amp;amp; but it does not work.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Can someone help me out?&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;thanks in advance&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;lisua&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 07:19:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-parse-various-date-formats/m-p/2236217#M25007</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T07:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to parse various date formats</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-parse-various-date-formats/m-p/2236218#M25008</link>
      <description>&lt;P&gt;Hi Lisua,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When we have multiple date formats on the same column, we should validate the date value by using isdate before parsing it to date .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;!Relational.ISNULL(row1.birth_date)?&lt;BR /&gt;(TalendDate.isDate(row1.birth_date,"MM/dd/yyyy")?&lt;BR /&gt;TalendDate.parseDate("MM/dd/yyyy",row1.birth_date):&lt;BR /&gt;TalendDate.isDate(row1.birth_date,"MM.dd.yyyy")?&lt;BR /&gt;TalendDate.parseDate("MM.dd.yyyy",row1.birth_date):&lt;BR /&gt;TalendDate.isDate(row1.birth_date,"yyyy")?&lt;BR /&gt;TalendDate.parseDate("yyyy",row1.birth_date): null&lt;BR /&gt;):null&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This logic will solve your problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If the answer has helped you, could you please mark the topic as resolved.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2018 18:30:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-parse-various-date-formats/m-p/2236218#M25008</guid>
      <dc:creator>ashif2</dc:creator>
      <dc:date>2018-11-09T18:30:06Z</dc:date>
    </item>
  </channel>
</rss>

