<?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 inconsistent date format in date field in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/inconsistent-date-format-in-date-field/m-p/2280357#M55230</link>
    <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm trying to clean up a date string field that has an inconsistent format.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2019-01-01, 01/01/2019 etc..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in previous ETL tool that i use, i will write up something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;IF
Contains([Service Dt],"-") THEN [Service Dt]
ELSEIF
Contains([Service Dt],"/") THEN Regex_Replace([Service Dt],"(\d{1,2})(/)(\d{1,2})(/)(\d{4})","$5-$1-$3")
ELSE
Null()
ENDIF

&lt;/PRE&gt;&lt;P&gt;How do i write this&amp;nbsp;&lt;SPAN&gt;formula in TMap?&amp;nbsp; or is there a better way of doing it?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 04:28:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T04:28:19Z</dc:date>
    <item>
      <title>inconsistent date format in date field</title>
      <link>https://community.qlik.com/t5/Talend-Studio/inconsistent-date-format-in-date-field/m-p/2280357#M55230</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm trying to clean up a date string field that has an inconsistent format.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2019-01-01, 01/01/2019 etc..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in previous ETL tool that i use, i will write up something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;IF
Contains([Service Dt],"-") THEN [Service Dt]
ELSEIF
Contains([Service Dt],"/") THEN Regex_Replace([Service Dt],"(\d{1,2})(/)(\d{1,2})(/)(\d{4})","$5-$1-$3")
ELSE
Null()
ENDIF

&lt;/PRE&gt;&lt;P&gt;How do i write this&amp;nbsp;&lt;SPAN&gt;formula in TMap?&amp;nbsp; or is there a better way of doing it?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:28:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/inconsistent-date-format-in-date-field/m-p/2280357#M55230</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T04:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: inconsistent date format in date field</title>
      <link>https://community.qlik.com/t5/Talend-Studio/inconsistent-date-format-in-date-field/m-p/2280358#M55231</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LQPgAAO"&gt;@Schrute_Farms&lt;/A&gt;&amp;nbsp;,you can use the below function in output of enable/Disable filter Expression. the below function will return true or false.here mydate should be string.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;TalendDate.isDate(row7.mydate,"yyyy-MM-dd")==true ?row7.mydate:null&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2019 10:14:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/inconsistent-date-format-in-date-field/m-p/2280358#M55231</guid>
      <dc:creator>manodwhb</dc:creator>
      <dc:date>2019-10-04T10:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: inconsistent date format in date field</title>
      <link>https://community.qlik.com/t5/Talend-Studio/inconsistent-date-format-in-date-field/m-p/2280359#M55232</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LQPgAAO"&gt;@Schrute_Farms&lt;/A&gt;&amp;nbsp;,for multiple condition you need to write below way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TalendDate.isDate(row7.mydate,"yyyy-MM-dd")==true || TalendDate.isDate(row7.mydate,"dd/MM/yyyy")==true ?row7.mydate:null&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2019 10:20:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/inconsistent-date-format-in-date-field/m-p/2280359#M55232</guid>
      <dc:creator>manodwhb</dc:creator>
      <dc:date>2019-10-04T10:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: inconsistent date format in date field</title>
      <link>https://community.qlik.com/t5/Talend-Studio/inconsistent-date-format-in-date-field/m-p/2280360#M55233</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LQPgAAO"&gt;@Schrute_Farms&lt;/A&gt;&amp;nbsp;as I understand, what you want is an expression to unify the output format.&lt;/P&gt; 
&lt;P&gt;Here is what my suggestion:&lt;/P&gt; 
&lt;PRE&gt;TalendDate.isDate(row29.value, "yyyy-MM-dd") ? row29.value : 
	TalendDate.isDate(row29.value, "dd/MM/yyyy") ? row29.value.substring(6) + "-" + row29.value.substring(3, 5) + "-" + row29.value.substring(0, 2) : "Not a valid date" &lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Oct 2019 15:46:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/inconsistent-date-format-in-date-field/m-p/2280360#M55233</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2019-10-04T15:46:34Z</dc:date>
    </item>
  </channel>
</rss>

