<?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 Tloop- compare hour with a value in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Tloop-compare-hour-with-a-value/m-p/2304094#M75902</link>
    <description>Hi
&lt;BR /&gt;I need the twaitforfile activity component to run until 4.pm, so I’m using the below condition coded in tloop component ( which is, trying to compare the current hour with a value) but I’m getting into various issues, any help is appreciated.
&lt;BR /&gt;Bigdecimal((TalendDate.getdate(“HH”)).compareTo(16) == -1
&lt;BR /&gt;
&lt;BR /&gt;Thanks
&lt;BR /&gt;Mj</description>
    <pubDate>Tue, 06 Mar 2018 21:26:06 GMT</pubDate>
    <dc:creator>borrisbeck</dc:creator>
    <dc:date>2018-03-06T21:26:06Z</dc:date>
    <item>
      <title>Tloop- compare hour with a value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tloop-compare-hour-with-a-value/m-p/2304094#M75902</link>
      <description>Hi
&lt;BR /&gt;I need the twaitforfile activity component to run until 4.pm, so I’m using the below condition coded in tloop component ( which is, trying to compare the current hour with a value) but I’m getting into various issues, any help is appreciated.
&lt;BR /&gt;Bigdecimal((TalendDate.getdate(“HH”)).compareTo(16) == -1
&lt;BR /&gt;
&lt;BR /&gt;Thanks
&lt;BR /&gt;Mj</description>
      <pubDate>Tue, 06 Mar 2018 21:26:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tloop-compare-hour-with-a-value/m-p/2304094#M75902</guid>
      <dc:creator>borrisbeck</dc:creator>
      <dc:date>2018-03-06T21:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Tloop- compare hour with a value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tloop-compare-hour-with-a-value/m-p/2304095#M75903</link>
      <description>&lt;PRE&gt;Bigdecimal((TalendDate.getdate(“HH”)).compareTo(&amp;nbsp; BigDecimal.valueOf(16)&amp;nbsp; )&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Mar 2018 21:44:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tloop-compare-hour-with-a-value/m-p/2304095#M75903</guid>
      <dc:creator>Jesperrekuh</dc:creator>
      <dc:date>2018-03-06T21:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Tloop- compare hour with a value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tloop-compare-hour-with-a-value/m-p/2304096#M75904</link>
      <description>Or this one without conversion:&lt;BR /&gt;(TalendDate.getdate(“HH”)).equals("16")&lt;BR /&gt;Should work.</description>
      <pubDate>Tue, 06 Mar 2018 21:56:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tloop-compare-hour-with-a-value/m-p/2304096#M75904</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2018-03-06T21:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: Tloop- compare hour with a value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tloop-compare-hour-with-a-value/m-p/2304097#M75905</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for responding, I tried that command, below is the exact command i used, actually my job may start around 8 and it has to run until 4.00 PM, with some sleep time in between. so i'm checking the current hour and minutes. for testing purpose i used a different time here,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(Bigdecimal((TalendDate.getdate("HH")).compareTo(Bigdecimal.valueof(10)) == -1 || Bigdecimal((TalendDate.getdate("HH")).compareTo(Bigdecimal.valueof(10)) == 0)))&amp;amp;&amp;amp;(Bigdecimal((TalendDate.getdate("mm")).compareTo(Bigdecimal.valueof(35)) == -1)  || (Bigdecimal((TalendDate.getdate("mm")).compareTo(Bigdecimal.valueof(35)) == 0)))&lt;/PRE&gt;
&lt;P&gt;but the job is failing with error&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;	- The method getdate(String) is undefined for the type TalendDate
	- Bigdecimal cannot be resolved&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 14:51:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tloop-compare-hour-with-a-value/m-p/2304097#M75905</guid>
      <dc:creator>borrisbeck</dc:creator>
      <dc:date>2018-03-07T14:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: Tloop- compare hour with a value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tloop-compare-hour-with-a-value/m-p/2304098#M75906</link>
      <description>&lt;P&gt;I put this in a tJava component and run this code.&lt;/P&gt;
&lt;PRE&gt;&lt;BR /&gt;Date x = routines.TalendDate.parseDate("HH:mm:ss", "12:00:00");
Date y = routines.TalendDate.parseDate("HH:mm:ss", "14:00:00");
System.out.println(y.after(x));&lt;/PRE&gt;
&lt;P&gt;This is more elegant&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 17:00:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tloop-compare-hour-with-a-value/m-p/2304098#M75906</guid>
      <dc:creator>Jesperrekuh</dc:creator>
      <dc:date>2018-03-07T17:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Tloop- compare hour with a value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tloop-compare-hour-with-a-value/m-p/2304099#M75907</link>
      <description>&lt;P&gt;Sorry, not sure, how can i use this in the tloop?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 18:17:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tloop-compare-hour-with-a-value/m-p/2304099#M75907</guid>
      <dc:creator>borrisbeck</dc:creator>
      <dc:date>2018-03-07T18:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: Tloop- compare hour with a value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tloop-compare-hour-with-a-value/m-p/2304100#M75908</link>
      <description>Hi&lt;BR /&gt;I have thought about the .equals solution, but it won’t work because, I want the job to run until the current time is less than or equal to 4 , that’s why I opted for the CompareTo operator.....&lt;BR /&gt;&lt;BR /&gt;Any other ideas please&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;MJ</description>
      <pubDate>Wed, 07 Mar 2018 21:40:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tloop-compare-hour-with-a-value/m-p/2304100#M75908</guid>
      <dc:creator>borrisbeck</dc:creator>
      <dc:date>2018-03-07T21:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Tloop- compare hour with a value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tloop-compare-hour-with-a-value/m-p/2304101#M75909</link>
      <description>&lt;P&gt;You want to run ... from startime : 05:00 until 16:30&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in &lt;STRONG&gt;tLoop&lt;/STRONG&gt;&amp;nbsp;change loop type from FOR into a WHILE,&lt;/P&gt;&lt;P&gt;next copypaste this into condition:&lt;/P&gt;&lt;PRE&gt;routines.TalendDate.parseDate("HH:mm:ss",routines.TalendDate.getDate("HH:mm:ss") ).before(routines.TalendDate.parseDate("HH:mm:ss", "16:30:00"))&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;you can leave the int i=0 and int++ as is...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to poll every second... connect via iterate a tSleep.&lt;/P&gt;&lt;P&gt;I've tested above solution and it works!&amp;nbsp;&lt;/P&gt;&lt;P&gt;If not the case I really dont get what you trying to achieve...&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;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LsXp"&gt;tLoop.jpg&lt;/A&gt;</description>
      <pubDate>Wed, 07 Mar 2018 22:26:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tloop-compare-hour-with-a-value/m-p/2304101#M75909</guid>
      <dc:creator>Jesperrekuh</dc:creator>
      <dc:date>2018-03-07T22:26:43Z</dc:date>
    </item>
  </channel>
</rss>

