<?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: Run IF condition is not working as expected in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Run-IF-condition-is-not-working-as-expected/m-p/2207182#M6922</link>
    <description>&lt;P&gt;Hi Nikhilthampi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I have similar issue while using for date column (but even after using relational.ISNULL / .equals(null)/ Length&amp;nbsp; I am having null pointer exceptions )&lt;BR /&gt;*********************************************Coded as below *******&amp;nbsp;&amp;nbsp;&lt;BR /&gt;(row2.P_SPECL_BEG_DT1.equals(null) || row2.P_SPECL_END_DT1.equals(null)) ||&amp;nbsp; --------- &amp;gt; checking fro null column&amp;nbsp;&lt;BR /&gt;(StringHandling.LEN(row2.P_SPECL_BEG_DT1.toString())==0 || StringHandling.LEN(row2.P_SPECL_END_DT1.toString())==0 ) ---&amp;gt; Checking if it is not null but o chars&lt;BR /&gt;? null :&lt;BR /&gt;!(TalendDate.isDate(row2.P_SPECL_BEG_DT1.toString(),"MM-dd-yyyy") &amp;amp;&amp;amp; TalendDate.isDate(row2.P_SPECL_END_DT1.toString(),"MM-dd-yyyy"))? null :&amp;nbsp; ---&amp;gt;checking if it is not desired date&amp;nbsp;&lt;BR /&gt;TalendDate.diffDate(row2.P_SPECL_END_DT1,row2.P_SPECL_BEG_DT1) &amp;lt; 0 ? " Error SPECL_BEG_DT1 &amp;gt; SPECL_END_DT1,"&lt;BR /&gt;:null&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;P&gt;**************************** Please let me know why even after handling nulls I am having Null pointer exception ***********&amp;nbsp; did I&amp;nbsp; miss anything here ...&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;please correct my basic if I am missing any here&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;attaching sample date values&amp;nbsp; for reference .... in which highlighted are null values coming and a 3 char word is another col in b/w which is not considered .&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/0683p000009LwhB"&gt;Capture.JPG&lt;/A&gt;</description>
    <pubDate>Fri, 13 Dec 2019 14:48:52 GMT</pubDate>
    <dc:creator>Sudhee_Maximus</dc:creator>
    <dc:date>2019-12-13T14:48:52Z</dc:date>
    <item>
      <title>Run IF condition is not working as expected</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Run-IF-condition-is-not-working-as-expected/m-p/2207177#M6917</link>
      <description>&lt;P&gt;In my tjava assigned below values ...&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;System.out.println("Testing the results");&lt;BR /&gt;System.out.println("*******************");&lt;/P&gt; 
&lt;P&gt;System.out.println("File_Name_Input_S3="+StringHandling.RIGHT((String)globalMap.get("row11.File_Name"),20));&lt;BR /&gt;System.out.println("File_Name_Derived="+context.File_Name_Header);&lt;BR /&gt;System.out.println("*******************");&lt;/P&gt; 
&lt;P&gt;System.out.println("MainJOb_Rowcount="+context.f_rowcount);&lt;BR /&gt;System.out.println("From child job="+(context.lines_processed+context.lines_errored ));&lt;BR /&gt;System.out.println("*******************");&lt;/P&gt; 
&lt;P&gt;System.out.println("Date_Boolean="+context.Date_boolean);&lt;/P&gt; 
&lt;P&gt;System.out.println("Testing results END");&lt;BR /&gt;System.out.println("*******************");&lt;BR /&gt;context.f_filename=StringHandling.RIGHT((String)globalMap.get("tFileExist_1_FILENAME"),20);&lt;BR /&gt;System.out.println("*******************");&lt;BR /&gt;System.out.println("f_filename="+context.f_filename);&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;my o/p also as below&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Testing the results&lt;BR /&gt;*******************&lt;BR /&gt;File_Name_Input_S3=AME_PROV20190611.DAT&lt;BR /&gt;File_Name_Derived=AME_PROV20190611.DAT&lt;BR /&gt;*******************&lt;BR /&gt;MainJOb_Rowcount=5054&lt;BR /&gt;From child job=5054&lt;BR /&gt;*******************&lt;BR /&gt;Date_Boolean=false&lt;BR /&gt;Testing results END&lt;BR /&gt;*******************&lt;BR /&gt;*******************&lt;BR /&gt;f_filename=AME_PROV20190611.DAT&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;but when I use the below condition in run if this is failing as resulting in false ....&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;context.File_Name_Header == context.f_filename&lt;BR /&gt;&amp;amp;&amp;amp;&lt;BR /&gt;context.f_rowcount == context.lines_processed+context.lines_errored&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 16:58:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Run-IF-condition-is-not-working-as-expected/m-p/2207177#M6917</guid>
      <dc:creator>Sudhee_Maximus</dc:creator>
      <dc:date>2019-12-10T16:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Run IF condition is not working as expected</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Run-IF-condition-is-not-working-as-expected/m-p/2207178#M6918</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp;Filename is a String and it would be ideal to use .equals() function to do data comparison. You will have to also handle null check using Relational.ISNULL function. Could you please make necessary changes and try it again?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; I am not giving exact answer so that you will get time to debug. If you are stuck, please feel free to come back.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt; 
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 05:34:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Run-IF-condition-is-not-working-as-expected/m-p/2207178#M6918</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-11T05:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: Run IF condition is not working as expected</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Run-IF-condition-is-not-working-as-expected/m-p/2207179#M6919</link>
      <description>&lt;P&gt;may I know why there is behavioral difference between == and .equals() , though I have used both in multiple occasions I was wondering why they both act differently ?&lt;BR /&gt;I have similar kind of ? on finding nulls&amp;nbsp;&lt;BR /&gt;used&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;not able to find nulls when used Relational.ISNULL&amp;nbsp; and == null but when used length(str)==0 was able to say the record is having no values ...&lt;BR /&gt;&lt;BR /&gt;may I ask you a favor&amp;nbsp;to explain it in detail elaboration on above scecnarios, so that many others can get benefited and clearly knows&amp;nbsp;how our tool works and expects the data to be like while performing above validations&amp;nbsp;...(something like a thumb rule for validations).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;There should be clear indications on when to use what&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 07:23:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Run-IF-condition-is-not-working-as-expected/m-p/2207179#M6919</guid>
      <dc:creator>Sudhee_Maximus</dc:creator>
      <dc:date>2019-12-11T07:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Run IF condition is not working as expected</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Run-IF-condition-is-not-working-as-expected/m-p/2207180#M6920</link>
      <description>&lt;A href="https://www.geeksforgeeks.org/difference-equals-method-java/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.geeksforgeeks.org/difference-equals-method-java/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;This might help.</description>
      <pubDate>Wed, 11 Dec 2019 12:53:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Run-IF-condition-is-not-working-as-expected/m-p/2207180#M6920</guid>
      <dc:creator>Raghuram_Puram</dc:creator>
      <dc:date>2019-12-11T12:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: Run IF condition is not working as expected</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Run-IF-condition-is-not-working-as-expected/m-p/2207181#M6921</link>
      <description>&lt;P&gt;Thanks that helped !&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 13:36:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Run-IF-condition-is-not-working-as-expected/m-p/2207181#M6921</guid>
      <dc:creator>Sudhee_Maximus</dc:creator>
      <dc:date>2019-12-11T13:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Run IF condition is not working as expected</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Run-IF-condition-is-not-working-as-expected/m-p/2207182#M6922</link>
      <description>&lt;P&gt;Hi Nikhilthampi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I have similar issue while using for date column (but even after using relational.ISNULL / .equals(null)/ Length&amp;nbsp; I am having null pointer exceptions )&lt;BR /&gt;*********************************************Coded as below *******&amp;nbsp;&amp;nbsp;&lt;BR /&gt;(row2.P_SPECL_BEG_DT1.equals(null) || row2.P_SPECL_END_DT1.equals(null)) ||&amp;nbsp; --------- &amp;gt; checking fro null column&amp;nbsp;&lt;BR /&gt;(StringHandling.LEN(row2.P_SPECL_BEG_DT1.toString())==0 || StringHandling.LEN(row2.P_SPECL_END_DT1.toString())==0 ) ---&amp;gt; Checking if it is not null but o chars&lt;BR /&gt;? null :&lt;BR /&gt;!(TalendDate.isDate(row2.P_SPECL_BEG_DT1.toString(),"MM-dd-yyyy") &amp;amp;&amp;amp; TalendDate.isDate(row2.P_SPECL_END_DT1.toString(),"MM-dd-yyyy"))? null :&amp;nbsp; ---&amp;gt;checking if it is not desired date&amp;nbsp;&lt;BR /&gt;TalendDate.diffDate(row2.P_SPECL_END_DT1,row2.P_SPECL_BEG_DT1) &amp;lt; 0 ? " Error SPECL_BEG_DT1 &amp;gt; SPECL_END_DT1,"&lt;BR /&gt;:null&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;P&gt;**************************** Please let me know why even after handling nulls I am having Null pointer exception ***********&amp;nbsp; did I&amp;nbsp; miss anything here ...&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;please correct my basic if I am missing any here&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;attaching sample date values&amp;nbsp; for reference .... in which highlighted are null values coming and a 3 char word is another col in b/w which is not considered .&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/0683p000009LwhB"&gt;Capture.JPG&lt;/A&gt;</description>
      <pubDate>Fri, 13 Dec 2019 14:48:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Run-IF-condition-is-not-working-as-expected/m-p/2207182#M6922</guid>
      <dc:creator>Sudhee_Maximus</dc:creator>
      <dc:date>2019-12-13T14:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Run IF condition is not working as expected</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Run-IF-condition-is-not-working-as-expected/m-p/2207183#M6923</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p0000078AXEAA2"&gt;@SudheeReddy&lt;/A&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Lets not dilute the original content by adding a different query to this post. Could you please create a new post with the details along with sample input records and expected output (do not ad them as images as we may not be able to copy them for testing)?&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Please also add the screen shot of your current job so that we will get what you are doing in your job.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt; 
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved&lt;/P&gt;</description>
      <pubDate>Sat, 14 Dec 2019 04:34:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Run-IF-condition-is-not-working-as-expected/m-p/2207183#M6923</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-14T04:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Run IF condition is not working as expected</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Run-IF-condition-is-not-working-as-expected/m-p/2207184#M6924</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/00539000006eKOgAAM"&gt;@nthampi&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;yes I felt same and raised in separate discussion.&lt;BR /&gt;&lt;BR /&gt;Initially I felt it is around same Null pointer but on different context so raised in same ...&lt;BR /&gt;&lt;BR /&gt;but thanks for your reply and help nikhil ....&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 05:25:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Run-IF-condition-is-not-working-as-expected/m-p/2207184#M6924</guid>
      <dc:creator>Sudhee_Maximus</dc:creator>
      <dc:date>2019-12-19T05:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Run IF condition is not working as expected</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Run-IF-condition-is-not-working-as-expected/m-p/2207185#M6925</link>
      <description>&lt;P&gt;For anyone who stumbles on this later, using .equals() also helped me. I was at first using "==" to compare two strings that I KNEW were equal to eachother. Turns out that .equals checks the values, and "==" checks if both objects correspond to the same location in memory. &lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 15:25:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Run-IF-condition-is-not-working-as-expected/m-p/2207185#M6925</guid>
      <dc:creator>aaronrums</dc:creator>
      <dc:date>2022-11-18T15:25:06Z</dc:date>
    </item>
  </channel>
</rss>

