<?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: PROBLEM IN COMPAREDATE FUNCTION in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/PROBLEM-IN-COMPAREDATE-FUNCTION/m-p/2227001#M18729</link>
    <description>Hello rhal_2.0, 
&lt;BR /&gt;You are right, my explaination is not top reason why i add also my job.&amp;nbsp; 
&lt;BR /&gt;But i try to explain myself again; in the code you attach in your post, you find the expression&amp;nbsp; 
&lt;B&gt;&lt;FONT size="2"&gt;&lt;FONT face="consolas, monaco, 'bitstream vera sans mono', 'courier new', courier, monospace"&gt;Var.MonthFirstDate&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt; that i get this expresssion 
&lt;BR /&gt; 
&lt;PRE&gt;TalendDate.getPartOfDate("MONTH",TalendDate.getCurrentDate())&lt;/PRE&gt; 
&lt;BR /&gt;So in December, i note that this code return like value &amp;nbsp;0 insteade of 12; reason why i writte this code bellow to fixe month 
&lt;BR /&gt; 
&lt;PRE&gt;Var.MonthFirstDate == 0 ?  "12/20/"+Var.YearFirstDate_1 :  Var.MonthFirstDate+"/20/"+Var.YearFirstDate&lt;/PRE&gt; 
&lt;BR /&gt;To resume my question; i mean my problem is in 
&lt;B&gt;TalendDate.comperaDate()&lt;/B&gt; function which is in var1, var4 and var5 
&lt;BR /&gt;For exemple in var1, i writte: 
&lt;BR /&gt; 
&lt;PRE&gt;TalendDate.compareDate(row2.Date_debut_arret_travail,Var.FirstDate1,"MM,dd,yyyy") &amp;lt;= 0 &amp;amp;&amp;amp;&lt;BR /&gt;TalendDate.compareDate(row2.Date_fin_arret_travail,Var.SecondDate1,"MM,dd,yyyy")&amp;gt;=0&lt;/PRE&gt; 
&lt;BR /&gt;I think this function does not work, i change the last part with:&amp;nbsp; 
&lt;B&gt;"MM/dd/yyyy"&lt;/B&gt; but it does not change nothing 
&lt;BR /&gt;Thanks for help,</description>
    <pubDate>Mon, 15 Feb 2016 15:03:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-02-15T15:03:23Z</dc:date>
    <item>
      <title>PROBLEM IN COMPAREDATE FUNCTION</title>
      <link>https://community.qlik.com/t5/Talend-Studio/PROBLEM-IN-COMPAREDATE-FUNCTION/m-p/2226999#M18727</link>
      <description>Dear All, 
&lt;BR /&gt;I face to a problem of CompareDate in my tMap and i try all solution but i still get wrong output. 
&lt;BR /&gt;The logic i apply is to fixe two Dates: 
&lt;BR /&gt; 
&lt;BR /&gt;Date1 that i call " 
&lt;B&gt;FirstDate&lt;/B&gt;" is in format MM/DD/yyyy and is fixed like that: &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;FONT color="#cccc33"&gt;previous Month/20/Year&lt;/FONT&gt; 
&lt;BR /&gt;Date2 that i call " 
&lt;B&gt;SecondeDate&lt;/B&gt;" is in format MM/DD/yyyy and is fixed like that: 
&lt;FONT color="#cccc33"&gt;current Month/19/Year&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;So to get output, i make some comparison of date that i call 
&lt;B&gt;var1, var4, var5&amp;nbsp;&lt;/B&gt; 
&lt;BR /&gt;And in my job i upload, i just apply 
&lt;B&gt;var4 &lt;/B&gt;but i get wrong output. 
&lt;BR /&gt; 
&lt;FONT color="#ff3333"&gt;Exemple of wrong output: All rows that year equal 2015&lt;/FONT&gt; 
&lt;BR /&gt;NB: In attach you find also my input file that i change format to txt so just put it in csv to make test 
&lt;BR /&gt;Thank you for help, 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/252461/Test_Indigo.zip.zip" target="_blank"&gt;Test_Indigo.zip.zip&lt;/A&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/252461/Evenement_utilisateur_Indigo.txt.txt" target="_blank"&gt;Evenement_utilisateur_Indigo.txt.txt&lt;/A&gt;</description>
      <pubDate>Wed, 03 Feb 2016 14:38:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/PROBLEM-IN-COMPAREDATE-FUNCTION/m-p/2226999#M18727</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-03T14:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM IN COMPAREDATE FUNCTION</title>
      <link>https://community.qlik.com/t5/Talend-Studio/PROBLEM-IN-COMPAREDATE-FUNCTION/m-p/2227000#M18728</link>
      <description>I'm afraid you will need to give an actual example of what is happening and simplify your question. I looked at your job briefly and what you are doing with dates looks like it can probably be simplified a fair bit. You say you get an error with the output of var4 connected to dates with 2015 as the year. I looked briefly at the code and this variable expression looked somewhat odd to me.... 
&lt;BR /&gt; 
&lt;PRE&gt;Var.MonthFirstDate == 0 ?  "12/20/"+Var.YearFirstDate_1 :  Var.MonthFirstDate+"/20/"+Var.YearFirstDate  &lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;It looks like when the month is January you are setting it back to December of the previous year, yet when it is any other month, the year remains as does the month.&amp;nbsp; 
&lt;BR /&gt;As I said, this is a wild guess because I do not know the requirement.&amp;nbsp;</description>
      <pubDate>Wed, 03 Feb 2016 15:30:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/PROBLEM-IN-COMPAREDATE-FUNCTION/m-p/2227000#M18728</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-03T15:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM IN COMPAREDATE FUNCTION</title>
      <link>https://community.qlik.com/t5/Talend-Studio/PROBLEM-IN-COMPAREDATE-FUNCTION/m-p/2227001#M18729</link>
      <description>Hello rhal_2.0, 
&lt;BR /&gt;You are right, my explaination is not top reason why i add also my job.&amp;nbsp; 
&lt;BR /&gt;But i try to explain myself again; in the code you attach in your post, you find the expression&amp;nbsp; 
&lt;B&gt;&lt;FONT size="2"&gt;&lt;FONT face="consolas, monaco, 'bitstream vera sans mono', 'courier new', courier, monospace"&gt;Var.MonthFirstDate&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt; that i get this expresssion 
&lt;BR /&gt; 
&lt;PRE&gt;TalendDate.getPartOfDate("MONTH",TalendDate.getCurrentDate())&lt;/PRE&gt; 
&lt;BR /&gt;So in December, i note that this code return like value &amp;nbsp;0 insteade of 12; reason why i writte this code bellow to fixe month 
&lt;BR /&gt; 
&lt;PRE&gt;Var.MonthFirstDate == 0 ?  "12/20/"+Var.YearFirstDate_1 :  Var.MonthFirstDate+"/20/"+Var.YearFirstDate&lt;/PRE&gt; 
&lt;BR /&gt;To resume my question; i mean my problem is in 
&lt;B&gt;TalendDate.comperaDate()&lt;/B&gt; function which is in var1, var4 and var5 
&lt;BR /&gt;For exemple in var1, i writte: 
&lt;BR /&gt; 
&lt;PRE&gt;TalendDate.compareDate(row2.Date_debut_arret_travail,Var.FirstDate1,"MM,dd,yyyy") &amp;lt;= 0 &amp;amp;&amp;amp;&lt;BR /&gt;TalendDate.compareDate(row2.Date_fin_arret_travail,Var.SecondDate1,"MM,dd,yyyy")&amp;gt;=0&lt;/PRE&gt; 
&lt;BR /&gt;I think this function does not work, i change the last part with:&amp;nbsp; 
&lt;B&gt;"MM/dd/yyyy"&lt;/B&gt; but it does not change nothing 
&lt;BR /&gt;Thanks for help,</description>
      <pubDate>Mon, 15 Feb 2016 15:03:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/PROBLEM-IN-COMPAREDATE-FUNCTION/m-p/2227001#M18729</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-15T15:03:23Z</dc:date>
    </item>
  </channel>
</rss>

