<?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 filter using in tMap in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/date-filter-using-in-tMap/m-p/2321738#M91742</link>
    <description>I know it has been nearly 4 years since you asked this question, and I do not know if GAT originally answered your question successfully for you, but I found a MUCH simpler way of doing it and I figured I'd share my answer in case anyone else comes looking: 
&lt;BR /&gt;Basically, using a similar set up, I had to insert specific data from table A database A to table B database B, given a certain date they had to be greater than. I put all these dates into a table C in database B, but obviously had no way of querying both database A and B at the same time to extrac the correct data. 
&lt;BR /&gt;Using the tMap component, with the main input from table A and a lookup input from table C and then an output to table B, I mapped the columns I needed (not including the date columns from both tables A and C) and then typed in the following statement in the Expression Filter above the output in the tMap view to get only the data for the correct dates: 
&lt;BR /&gt;row1.All_Source_Dates.after(row2.Last_Target_Update_Date) 
&lt;BR /&gt;All_Source_Dates and Last_Target_Update_Date are my 2 date columns for tables A and C. The .after bit is what represents the ' &amp;gt; ' sign in sql code. You can interchange this with .equals and .before for similar commands. 
&lt;BR /&gt;I hope this comes in handy to anyone who looks it up. 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;V Pem.</description>
    <pubDate>Tue, 13 Jan 2015 17:15:40 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-01-13T17:15:40Z</dc:date>
    <item>
      <title>date filter using in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/date-filter-using-in-tMap/m-p/2321736#M91740</link>
      <description>I tried to use expression filter in tMap. But I couldn't get it work for dates.
&lt;BR /&gt;If I put, for example, row1.BIRTH_DATE &amp;gt;="01/01/1980", then I'll get the error message as
&lt;BR /&gt;"The Operator&amp;gt;=is undefined for the argument type(s) Date, String"
&lt;BR /&gt;If I put row1.BIRTH_DATE&amp;gt;=TalendDate.parseDate(?MM/dd/yyyy?,"01/01/1980"), I got the following "The operator &amp;gt;= is undefined for the argument type(s) java.util.Date, java.util.Date"
&lt;BR /&gt;I don't know hot to make it the right way. Could anyone give me some corrections?
&lt;BR /&gt;Thanks!</description>
      <pubDate>Sat, 16 Nov 2024 12:43:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/date-filter-using-in-tMap/m-p/2321736#M91740</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: date filter using in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/date-filter-using-in-tMap/m-p/2321737#M91741</link>
      <description>Hi,&lt;BR /&gt;You should use Talend methods from TalendDate system routines.&lt;BR /&gt;For example, &lt;BR /&gt; * -&amp;gt;&amp;gt; compareDate(2008/11/24 12:15:25, 2008/11/24 16:10:35,"yyyy/MM/dd") return 0 #&lt;BR /&gt;     */&lt;BR /&gt;    public static int compareDate(Date date1, Date date2, String pattern) {&lt;BR /&gt;        if (date1 == null &amp;amp;&amp;amp; date2 == null) {&lt;BR /&gt;            return 0;&lt;BR /&gt;        } else if (date1 != null &amp;amp;&amp;amp; date2 == null) {&lt;BR /&gt;            return 1;&lt;BR /&gt;        } else if (date1 == null &amp;amp;&amp;amp; date2 != null) {&lt;BR /&gt;            return -1;&lt;BR /&gt;        }&lt;BR /&gt;        if (pattern != null) {&lt;BR /&gt;            SimpleDateFormat sdf = new SimpleDateFormat(pattern);&lt;BR /&gt;            String part1 = sdf.format(date1), part2 = sdf.format(date2);&lt;BR /&gt;            return (part1.compareTo(part2) &amp;gt;= 1 ? 1 : (part1.compareTo(part2) &amp;lt;= -1 ? -1 : 0));&lt;BR /&gt;        } else {&lt;BR /&gt;            long time1 = date1.getTime(), time2 = date2.getTime();&lt;BR /&gt;            return (time1 &amp;lt; time2 ? -1 : (time1 == time2 ? 0 : 1));&lt;BR /&gt;        }&lt;BR /&gt;    }&lt;BR /&gt;syntax : TalendDate.compareDate(new Date(),new Date(),"yyyy-MM-dd")&lt;BR /&gt;Best regards,&lt;BR /&gt;GAT</description>
      <pubDate>Fri, 19 Aug 2011 22:35:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/date-filter-using-in-tMap/m-p/2321737#M91741</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-19T22:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: date filter using in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/date-filter-using-in-tMap/m-p/2321738#M91742</link>
      <description>I know it has been nearly 4 years since you asked this question, and I do not know if GAT originally answered your question successfully for you, but I found a MUCH simpler way of doing it and I figured I'd share my answer in case anyone else comes looking: 
&lt;BR /&gt;Basically, using a similar set up, I had to insert specific data from table A database A to table B database B, given a certain date they had to be greater than. I put all these dates into a table C in database B, but obviously had no way of querying both database A and B at the same time to extrac the correct data. 
&lt;BR /&gt;Using the tMap component, with the main input from table A and a lookup input from table C and then an output to table B, I mapped the columns I needed (not including the date columns from both tables A and C) and then typed in the following statement in the Expression Filter above the output in the tMap view to get only the data for the correct dates: 
&lt;BR /&gt;row1.All_Source_Dates.after(row2.Last_Target_Update_Date) 
&lt;BR /&gt;All_Source_Dates and Last_Target_Update_Date are my 2 date columns for tables A and C. The .after bit is what represents the ' &amp;gt; ' sign in sql code. You can interchange this with .equals and .before for similar commands. 
&lt;BR /&gt;I hope this comes in handy to anyone who looks it up. 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;V Pem.</description>
      <pubDate>Tue, 13 Jan 2015 17:15:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/date-filter-using-in-tMap/m-p/2321738#M91742</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-13T17:15:40Z</dc:date>
    </item>
  </channel>
</rss>

