<?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: How to split Date, Time field and apply a condition using expression function in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-split-Date-Time-field-and-apply-a-condition-using/m-p/2213943#M10992</link>
    <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LQI2AAO"&gt;@KathikVenky&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;The compare (.&amp;gt; &amp;amp; &amp;lt;) that you are trying to perform won't work in case of date or strings. You need to use&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;TalendDate.compareDate
compare two date
 @param date1 (first date)
 @param date2 (second date)
 @param pattern (compare specified part, example: "yyyy-MM-dd")
 @return the result wheather two date is the same, if first one less than second one return number -1, equlas
 return number 0, bigger than return number 1. (can compare partly)

 &lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;So, all you need to do is convert your&amp;nbsp;&lt;SPAN&gt;'00:00:00.000' &amp;amp;&amp;nbsp;'06:00:00.000' and perform the calculation and derive your flow.&lt;BR /&gt;Something like this -&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;PRE&gt;TalendDate.parseDate("HH:mm:ss.SSS",TalendDate.formatDate("HH:mm:ss.SSS", splitdate1.splitDate))&lt;BR /&gt;TalendDate.parseDate("HH:mm:ss.SSS","00:00:00.000")
TalendDate.parseDate("HH:mm:ss.SSS","06:00:00.000")

--compare
(TalendDate.compareDate(Var.var1,Var.var2,"HH:mm:ss.SSS") &amp;gt;= 1 &amp;amp;&amp;amp; TalendDate.compareDate(Var.var3,Var.var1,"HH:mm:ss.SSS") &amp;gt;= 1) ? 1 : 0 &lt;/PRE&gt;</description>
    <pubDate>Tue, 27 Aug 2019 11:07:49 GMT</pubDate>
    <dc:creator>iamabhishek</dc:creator>
    <dc:date>2019-08-27T11:07:49Z</dc:date>
    <item>
      <title>How to split Date, Time field and apply a condition using expression function</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-split-Date-Time-field-and-apply-a-condition-using/m-p/2213940#M10989</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using tmap, I am trying to get a Date and Time field (2018-04-07 12:53:55.557) from one table and trying to validate below conditional check to pass date and shift details to another table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Condition for Date Field is as follows:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to take time from above field(12:53:55.557) and check for condition is it &amp;gt;&amp;nbsp;'00:00:00.000' &amp;amp;&amp;amp;&amp;nbsp;&amp;lt; '06:00:00.000' if it so I need to subtract one from above date field and push to other table(2018-04-06)&amp;nbsp; else I need to pass same date to that table(2018-04-07)&lt;/P&gt;
&lt;P&gt;Condition for Sift Details are as follows:&lt;/P&gt;
&lt;P&gt;I need to take time from above field((12:53:55.557) ) and need to check in which shift it belongs to and send the shift details(A,B,C) to another table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please find the attached screen shots for your reference and assist me how this can be solved using talend expression function.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:51:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-split-Date-Time-field-and-apply-a-condition-using/m-p/2213940#M10989</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T04:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to split Date, Time field and apply a condition using expression function</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-split-Date-Time-field-and-apply-a-condition-using/m-p/2213941#M10990</link>
      <description>did you have date or string?&lt;BR /&gt;have a look at "Java SimpleDateFormat" or use Talend Date Routines:&lt;BR /&gt;&lt;A href="https://help.talend.com/reader/~R4Lk_SlELw9a8pKBKTm9A/JFWl8U3lEbhWZEFAUtYvMw" target="_blank" rel="nofollow noopener noreferrer"&gt;https://help.talend.com/reader/~R4Lk_SlELw9a8pKBKTm9A/JFWl8U3lEbhWZEFAUtYvMw&lt;/A&gt;</description>
      <pubDate>Tue, 27 Aug 2019 09:52:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-split-Date-Time-field-and-apply-a-condition-using/m-p/2213941#M10990</guid>
      <dc:creator>fdenis</dc:creator>
      <dc:date>2019-08-27T09:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to split Date, Time field and apply a condition using expression function</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-split-Date-Time-field-and-apply-a-condition-using/m-p/2213942#M10991</link>
      <description>&lt;P&gt;Thank you for your update denis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have date field(row1.D_FIN_F) and its format is (2018-04-07 12:53:55.557). I have tried using the Talend Date routines -&amp;nbsp;TalendDate.formatDate("yyyy-MM-dd", row1.D_FIN_F) but when i test it doesn't works. PFA&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LwEw"&gt;Talend_ExpressionTag1.JPG&lt;/A&gt;</description>
      <pubDate>Tue, 27 Aug 2019 10:12:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-split-Date-Time-field-and-apply-a-condition-using/m-p/2213942#M10991</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-27T10:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to split Date, Time field and apply a condition using expression function</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-split-Date-Time-field-and-apply-a-condition-using/m-p/2213943#M10992</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LQI2AAO"&gt;@KathikVenky&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;The compare (.&amp;gt; &amp;amp; &amp;lt;) that you are trying to perform won't work in case of date or strings. You need to use&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;TalendDate.compareDate
compare two date
 @param date1 (first date)
 @param date2 (second date)
 @param pattern (compare specified part, example: "yyyy-MM-dd")
 @return the result wheather two date is the same, if first one less than second one return number -1, equlas
 return number 0, bigger than return number 1. (can compare partly)

 &lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;So, all you need to do is convert your&amp;nbsp;&lt;SPAN&gt;'00:00:00.000' &amp;amp;&amp;nbsp;'06:00:00.000' and perform the calculation and derive your flow.&lt;BR /&gt;Something like this -&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;PRE&gt;TalendDate.parseDate("HH:mm:ss.SSS",TalendDate.formatDate("HH:mm:ss.SSS", splitdate1.splitDate))&lt;BR /&gt;TalendDate.parseDate("HH:mm:ss.SSS","00:00:00.000")
TalendDate.parseDate("HH:mm:ss.SSS","06:00:00.000")

--compare
(TalendDate.compareDate(Var.var1,Var.var2,"HH:mm:ss.SSS") &amp;gt;= 1 &amp;amp;&amp;amp; TalendDate.compareDate(Var.var3,Var.var1,"HH:mm:ss.SSS") &amp;gt;= 1) ? 1 : 0 &lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Aug 2019 11:07:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-split-Date-Time-field-and-apply-a-condition-using/m-p/2213943#M10992</guid>
      <dc:creator>iamabhishek</dc:creator>
      <dc:date>2019-08-27T11:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to split Date, Time field and apply a condition using expression function</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-split-Date-Time-field-and-apply-a-condition-using/m-p/2213944#M10993</link>
      <description>you may stay in date type.&lt;BR /&gt;creating new date from TO_DATE(TalendDate.formatDate("CCYY-MM-DD", row1.D_FIN_F),"CCYY-MM-DD")&lt;BR /&gt;use diffdate on hours to get h&lt;BR /&gt;then check if 0&amp;lt;h&amp;lt;6&lt;BR /&gt;</description>
      <pubDate>Tue, 27 Aug 2019 11:13:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-split-Date-Time-field-and-apply-a-condition-using/m-p/2213944#M10993</guid>
      <dc:creator>fdenis</dc:creator>
      <dc:date>2019-08-27T11:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to split Date, Time field and apply a condition using expression function</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-split-Date-Time-field-and-apply-a-condition-using/m-p/2213945#M10994</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LKrZAAW"&gt;@iamabhishek&lt;/A&gt;&amp;nbsp;Thank you very much.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 05:55:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-split-Date-Time-field-and-apply-a-condition-using/m-p/2213945#M10994</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-28T05:55:24Z</dc:date>
    </item>
  </channel>
</rss>

