<?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 Date comparison in Tmap fails in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Date-comparison-in-Tmap-fails/m-p/2264245#M44145</link>
    <description>I have two dates, one coming from source and other one from Global. 
&lt;BR /&gt;from source is srce.code_desc_event_date which is string in the format 20131231 and 
&lt;BR /&gt;from global is srce_max_date in date format. 
&lt;BR /&gt;Business rule: Build filter to pass If Global date is NULL or Source Date is &amp;gt;= Global date. 
&lt;BR /&gt;I have following code written but it fails, any help would be greatly appreciated. 
&lt;BR /&gt;((String)globalMap.get("srce_max_date")) == null || 
&lt;BR /&gt; (TalendDate.parseDate("dd-MM-yyyy", 
&lt;BR /&gt;TalendDate.formatDate("dd-MM-yyyy", TalendDate.parseDate("MM/dd/yyyy",srce.code_desc_event_date))) 
&lt;BR /&gt;.equals((Date)globalMap.get("srce_max_date")) 
&lt;BR /&gt;|| 
&lt;BR /&gt;TalendDate.parseDate("MM/dd/yyyy",srce.code_desc_event_date).after((Date)globalMap.get("srce_max_date")) 
&lt;BR /&gt;) 
&lt;BR /&gt; 
&lt;BR /&gt;thanks in advance.. happy Talend programming to all. 
&lt;BR /&gt;!John</description>
    <pubDate>Wed, 22 Jan 2014 19:24:21 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2014-01-22T19:24:21Z</dc:date>
    <item>
      <title>Date comparison in Tmap fails</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Date-comparison-in-Tmap-fails/m-p/2264245#M44145</link>
      <description>I have two dates, one coming from source and other one from Global. 
&lt;BR /&gt;from source is srce.code_desc_event_date which is string in the format 20131231 and 
&lt;BR /&gt;from global is srce_max_date in date format. 
&lt;BR /&gt;Business rule: Build filter to pass If Global date is NULL or Source Date is &amp;gt;= Global date. 
&lt;BR /&gt;I have following code written but it fails, any help would be greatly appreciated. 
&lt;BR /&gt;((String)globalMap.get("srce_max_date")) == null || 
&lt;BR /&gt; (TalendDate.parseDate("dd-MM-yyyy", 
&lt;BR /&gt;TalendDate.formatDate("dd-MM-yyyy", TalendDate.parseDate("MM/dd/yyyy",srce.code_desc_event_date))) 
&lt;BR /&gt;.equals((Date)globalMap.get("srce_max_date")) 
&lt;BR /&gt;|| 
&lt;BR /&gt;TalendDate.parseDate("MM/dd/yyyy",srce.code_desc_event_date).after((Date)globalMap.get("srce_max_date")) 
&lt;BR /&gt;) 
&lt;BR /&gt; 
&lt;BR /&gt;thanks in advance.. happy Talend programming to all. 
&lt;BR /&gt;!John</description>
      <pubDate>Wed, 22 Jan 2014 19:24:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Date-comparison-in-Tmap-fails/m-p/2264245#M44145</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2014-01-22T19:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Date comparison in Tmap fails</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Date-comparison-in-Tmap-fails/m-p/2264246#M44146</link>
      <description>I guess the value srce_max_date is a Date type object.&lt;BR /&gt;&lt;PRE&gt;(globalMap.get("srce_max_date")) == null || &lt;BR /&gt;  TalendDate.parseDate("yyyyMMdd", srce.code_desc_event_date).before((Date) globalMap.get("srce_max_date")) == false&lt;BR /&gt;)&lt;/PRE&gt;&lt;BR /&gt;First of all, why do you do not use the format your string get yyyyMMdd and struggle with a lot of converts (all wrong)?&lt;BR /&gt;Instead of asking equals or after you could simply ask: not before.</description>
      <pubDate>Wed, 22 Jan 2014 20:30:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Date-comparison-in-Tmap-fails/m-p/2264246#M44146</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-01-22T20:30:14Z</dc:date>
    </item>
  </channel>
</rss>

