<?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: [resolved] WRONG OUTPUT IN COMPARE DATE in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-WRONG-OUTPUT-IN-COMPARE-DATE/m-p/2308326#M79671</link>
    <description>Dear all,&lt;BR /&gt;Somebody has solution to suggest to me please?&lt;BR /&gt;&lt;BR /&gt;Thanks,</description>
    <pubDate>Fri, 06 Nov 2015 09:21:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-11-06T09:21:36Z</dc:date>
    <item>
      <title>[resolved] WRONG OUTPUT IN COMPARE DATE</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-WRONG-OUTPUT-IN-COMPARE-DATE/m-p/2308325#M79670</link>
      <description>&lt;P&gt;Dear All,&lt;BR /&gt;I am working on a job and i don't understand my out data because after many tests everything look good.&lt;BR /&gt;I have an input file with a date column and objective is to classify all rows by month&lt;BR /&gt;Example:&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#993333"&gt;Input file with date MM/dd/yyyy&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;MLarronde;10/05/2015;Parrot;Parrot EPM &amp;amp; COMP;Billable;ACCEPTED&lt;BR /&gt;MLarronde;10/06/2015;Parrot;Parrot EPM &amp;amp; COMP;Billable;ACCEPTED&lt;BR /&gt;&lt;FONT color="#3333ff"&gt;MLarronde;10/31/2015;Parrot;Parrot EPM &amp;amp; COMP;Billable;ACCEPTED&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3333ff"&gt;MLarronde;10/01/2015;Parrot;Parrot EPM &amp;amp; COMP;Billable;ACCEPTED&lt;/FONT&gt;&lt;BR /&gt;svautrot;09/15/2015;Bureau Veritas;Bureau Veritas - LMS ILT;Billable;ACCEPTED&lt;BR /&gt;svautrot;09/16/2015;WHO;Testing support;Billable;ACCEPTED&lt;BR /&gt;svautrot;09/16/2015;Bureau Veritas;Bureau Veritas - LMS ILT;Billable;ACCEPTED&lt;BR /&gt;&lt;FONT color="#3333ff"&gt;svautrot;09/01/2015;Bureau Veritas;Bureau Veritas - LMS ILT;Billable;ACCEPTED&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;With these inputs i get this output&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#993333"&gt;Output file for previous month (October)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;MLarronde;10/05/2015;Parrot;Parrot EPM &amp;amp; COMP;Billable;ACCEPTED&lt;BR /&gt;MLarronde;10/06/2015;Parrot;Parrot EPM &amp;amp; COMP;Billable;ACCEPTED&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#993333"&gt;Output file for month September&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;svautrot;09/15/2015;Bureau Veritas;Bureau Veritas - LMS ILT;Billable;ACCEPTED&lt;BR /&gt;svautrot;09/16/2015;WHO;Testing support;Billable;ACCEPTED&lt;BR /&gt;svautrot;09/16/2015;Bureau Veritas;Bureau Veritas - LMS ILT;Billable;ACCEPTED&lt;BR /&gt;&lt;BR /&gt;Screenshot of my tMap&amp;nbsp;&lt;BR /&gt;&lt;A href="https://community.talend.com/legacyfs/online/252461/Capturegrgp.jpg" target="_blank" rel="noopener"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGsU.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144725i49FF535791E6F950/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGsU.jpg" alt="0683p000009MGsU.jpg" /&gt;&lt;/span&gt; &lt;/A&gt;&lt;BR /&gt;First i generate 2 variables which are &lt;FONT color="#3333ff"&gt;FirstDay_currentDate&lt;/FONT&gt; and &lt;FONT color="#3333ff"&gt;LastDay_currentDate&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3333ff"&gt;FirstDay_currentDate expression&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;==&amp;gt;&amp;nbsp;TalendDate.getFirstDayOfMonth(TalendDate.getCurrentDate())&amp;nbsp;&lt;BR /&gt;&lt;FONT color="#3333ff"&gt;LastDay_currentDate&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#3333ff"&gt;expression&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;==&amp;gt;&amp;nbsp;TalendDate.getLastDayOfMonth(TalendDate.getCurrentDate())&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;For October output file, i do this condition:&lt;/P&gt; 
&lt;PRE&gt;TalendDate.compareDate(row24.activityDate,TalendDate.addDate(Var.FirstDay_currentDate,-1,"MM")) &amp;gt;= 0 &amp;amp;&amp;amp; &lt;BR /&gt;TalendDate.compareDate(row24.activityDate,TalendDate.addDate(Var.LastDay_currentDate,-1,"MM")) &amp;lt;= 0 &lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;And for September output file, i do this condition:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt; 
&lt;PRE&gt;TalendDate.compareDate(row24.activityDate,TalendDate.addDate(Var.FirstDay_currentDate,-2,"MM")) &amp;gt;= 0 &amp;amp;&amp;amp; &lt;BR /&gt;TalendDate.compareDate(row24.activityDate,TalendDate.addDate(Var.LastDay_currentDate,-2,"MM")) &amp;lt;= 0 &lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Please help me solve this problem, because i don't know why i don't get blue rows&lt;BR /&gt;&lt;FONT color="#3333ff"&gt;MLarronde;10/31/2015;Parrot;Parrot EPM &amp;amp; COMP;Billable;ACCEPTED&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3333ff"&gt;MLarronde;10/01/2015;Parrot;Parrot EPM &amp;amp; COMP;Billable;ACCEPTED&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3333ff"&gt;svautrot;09/01/2015;Bureau Veritas;Bureau Veritas - LMS ILT;Billable;ACCEPTED&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2015 18:08:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-WRONG-OUTPUT-IN-COMPARE-DATE/m-p/2308325#M79670</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-05T18:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] WRONG OUTPUT IN COMPARE DATE</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-WRONG-OUTPUT-IN-COMPARE-DATE/m-p/2308326#M79671</link>
      <description>Dear all,&lt;BR /&gt;Somebody has solution to suggest to me please?&lt;BR /&gt;&lt;BR /&gt;Thanks,</description>
      <pubDate>Fri, 06 Nov 2015 09:21:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-WRONG-OUTPUT-IN-COMPARE-DATE/m-p/2308326#M79671</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-06T09:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] WRONG OUTPUT IN COMPARE DATE</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-WRONG-OUTPUT-IN-COMPARE-DATE/m-p/2308327#M79672</link>
      <description>I'm not sure I fully understand what you are doing here, but the first thing I would check would be the TalendDate.compareDate() sections. You are getting the current date and working with that assuming that it will hold just the day information. It will also contain a time element. You are comparing against other dates which I assume may also have time elements. If you compare 01/01/2000 with 01/01/2000, you expect a result of 0 (the same). But if you compare 01/01/2000 12:02 with 01/01/2000 12:01 you will get 1 or 01/01/2000 12:01 with 01/01/2000 12:02 you will get -1. You need to ensure that you beginning of month and end of month dates are exactly the beginning and end....down to the millisecond.&amp;nbsp;</description>
      <pubDate>Fri, 06 Nov 2015 09:37:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-WRONG-OUTPUT-IN-COMPARE-DATE/m-p/2308327#M79672</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-06T09:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] WRONG OUTPUT IN COMPARE DATE</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-WRONG-OUTPUT-IN-COMPARE-DATE/m-p/2308328#M79673</link>
      <description>Dear rhall_2.0?
&lt;BR /&gt;Your explanation is right, but in my tMap i define date format MM/dd/yyyy so normally everything should be good.
&lt;BR /&gt;I attach my job to this post
&lt;BR /&gt;Thanks,
&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="https://community.talend.com/legacyfs/online/252461/testDatebool.zip.zip" target="_blank"&gt;testDatebool.zip.zip&lt;/A&gt;</description>
      <pubDate>Fri, 06 Nov 2015 10:08:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-WRONG-OUTPUT-IN-COMPARE-DATE/m-p/2308328#M79673</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-06T10:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] WRONG OUTPUT IN COMPARE DATE</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-WRONG-OUTPUT-IN-COMPARE-DATE/m-p/2308329#M79674</link>
      <description>Your start and end dates are defined by getCurrentDate() in your tMap variables. Try something like this for the first day of the month.... 
&lt;BR /&gt; 
&lt;PRE&gt;TalendDate.getFirstDayOfMonth(TalendDate.parseDate("yyyy-MM-dd",TalendDate.formatDate("yyyy-MM-dd", TalendDate.getCurrentDate())))&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;For the last day of the month you will actually need to set the time to 23:59:59.9999 or set it to the very next day (beginning of the next month) with a time of 00:00:00.0000 and change your logic slightly to account for that.</description>
      <pubDate>Fri, 06 Nov 2015 10:34:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-WRONG-OUTPUT-IN-COMPARE-DATE/m-p/2308329#M79674</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-06T10:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] WRONG OUTPUT IN COMPARE DATE</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-WRONG-OUTPUT-IN-COMPARE-DATE/m-p/2308330#M79675</link>
      <description>Dear rhall_2.0,
&lt;BR /&gt;Thank you very much for your solution, i have changed my logic and it works.</description>
      <pubDate>Fri, 06 Nov 2015 16:19:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-WRONG-OUTPUT-IN-COMPARE-DATE/m-p/2308330#M79675</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-06T16:19:04Z</dc:date>
    </item>
  </channel>
</rss>

