<?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: Need Help for if - Else in tJavaRow in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212676#M10218</link>
    <description>Hi Neneow,&lt;BR /&gt;try not to check on a null value but on an empty string "".&lt;BR /&gt;&lt;PRE&gt;if (input_row.nma_pat != "") {&lt;BR /&gt;output_row.nom_pat = input_row.nma_pat;&lt;BR /&gt;output_row.nma_pat = "";}&lt;BR /&gt;else { output_row.nom_pat = input_row.nom_pat;}&lt;/PRE&gt;&lt;BR /&gt;Does that do the trick?&lt;BR /&gt;Mike</description>
    <pubDate>Tue, 30 Dec 2008 15:26:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-12-30T15:26:58Z</dc:date>
    <item>
      <title>Need Help for if - Else in tJavaRow</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212672#M10214</link>
      <description>Hi, 
&lt;BR /&gt;I'am a beginner on Talend and Java language. 
&lt;BR /&gt;I do a job who request on Informix DB with two tMap and one tUnit for generate a Directory of personns. The Job works fine. But i have a problem for reverse column at the end of job in my csv. 
&lt;BR /&gt;in fact : My csv contain : Name - married name - FirstName. I just want : if married name is different of null, the name = married name. 
&lt;BR /&gt;At the end of my job, juste before generate my final csv, i have add between my tUnit and the cvs output file a tJavaRow coponent, who i haved generate the java code correctely 
&lt;BR /&gt;(exemple 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MA5A.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/143082iB236712184B767DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MA5A.png" alt="0683p000009MA5A.png" /&gt;&lt;/span&gt;utput_row.nom_pat = input_row.nom_pat; (name) 
&lt;BR /&gt; output_row.nma_pat = input_row.nma_pat; (married name) 
&lt;BR /&gt;And i have add this code : 
&lt;BR /&gt;if (input_row.nma_pat != null) { 
&lt;BR /&gt;output_row.nom_pat = input_row.nma_pat; 
&lt;BR /&gt;output_row.nma_pat = "";} 
&lt;BR /&gt;else { output_row.nom_pat = input_row.nom_pat;} 
&lt;BR /&gt;With that, the job runs correctly, when a line contains a married name, i have this married name in the collumn of name, but the others lines who havent married name (male) have a null name. This is my problem. I think my If - Else is not good. 
&lt;BR /&gt;I hope someone could help me ! 
&lt;BR /&gt;Thanks before, and sorry for my poor english!</description>
      <pubDate>Sat, 16 Nov 2024 14:06:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212672#M10214</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T14:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help for if - Else in tJavaRow</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212673#M10215</link>
      <description>No one for help me ? I just need a java code for if a filed is not null, an other field = this field. But only the field who are not null and not allez my csv. Is very important. Thanks</description>
      <pubDate>Tue, 30 Dec 2008 13:01:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212673#M10215</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-30T13:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help for if - Else in tJavaRow</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212674#M10216</link>
      <description>Hi,
&lt;BR /&gt;Please, could you explain a little bit your need.
&lt;BR /&gt;We have several solutions to do that.
&lt;BR /&gt;You could use a ternary expression or also add a simple routine in Code repository.
&lt;BR /&gt;Before explain these two ways, could you describe some sample input rows, and some expected output rows.
&lt;BR /&gt;Then we could probably help you on that need.
&lt;BR /&gt;Best regards;</description>
      <pubDate>Tue, 30 Dec 2008 14:22:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212674#M10216</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-30T14:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help for if - Else in tJavaRow</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212675#M10217</link>
      <description>Hi, 
&lt;BR /&gt;Thanks for your answer. I will try to speak in comprehensible english 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt; : 
&lt;BR /&gt;My first Job work fine, its certainly not optimize but it's work. i must generate an patient's directory for an vocal standard from informix database. i describes you my lasts components : 
&lt;BR /&gt;After tMap, request and other i have in output two csv files. This two file have got the same schemas : 
&lt;BR /&gt;-iddossier 
&lt;BR /&gt;-nom (name) 
&lt;BR /&gt;-nma (married name) 
&lt;BR /&gt;-prenom 
&lt;BR /&gt;-sexe 
&lt;BR /&gt;-den 
&lt;BR /&gt;-dso 
&lt;BR /&gt;-service 
&lt;BR /&gt;-chambre 
&lt;BR /&gt;I merges this two file with tUnit component (same schemas) on a csv output file (same schemas). The problem is that : In my database for married women , the married name is insert into "nma" and maiden name in "nom". In my directory i want the married name and not "nom". 
&lt;BR /&gt;I just want for some lines of my csv who have got a married name, swhitch this column into "nom". I hope you understand 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt; For that between tUnit and ouput csv i have add an tJavaRow, i have clik on generate code and i add to that little code of java (i don't know java). 
&lt;BR /&gt;"output_row.iddossier = input_row.iddossier; 
&lt;BR /&gt;output_row.nom_pat = input_row.nom_pat; 
&lt;BR /&gt;output_row.nma_pat = input_row.nma_pat; 
&lt;BR /&gt;if (input_row.nma_pat != null) { 
&lt;BR /&gt;output_row.nom_pat = input_row.nma_pat; 
&lt;BR /&gt;output_row.nma_pat = "";} 
&lt;BR /&gt;else { output_row.nom_pat = input_row.nom_pat;} 
&lt;BR /&gt;output_row.pre_pat = input_row.pre_pat; 
&lt;BR /&gt;output_row.sex_pat = input_row.sex_pat; 
&lt;BR /&gt;output_row.den_dossier = input_row.den_dossier; 
&lt;BR /&gt;output_row.dso_dossier = input_row.dso_dossier; 
&lt;BR /&gt;output_row.ser_dos = input_row.ser_dos; 
&lt;BR /&gt;output_row.nch_sej = input_row.nch_sej;" 
&lt;BR /&gt;That work because all the "nm"a are put in "nom" collumn, thats i want. But all others name's without married name (male or women not married) disappear. 
&lt;BR /&gt;I hope u are understand what i want to do.</description>
      <pubDate>Tue, 30 Dec 2008 15:21:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212675#M10217</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-30T15:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help for if - Else in tJavaRow</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212676#M10218</link>
      <description>Hi Neneow,&lt;BR /&gt;try not to check on a null value but on an empty string "".&lt;BR /&gt;&lt;PRE&gt;if (input_row.nma_pat != "") {&lt;BR /&gt;output_row.nom_pat = input_row.nma_pat;&lt;BR /&gt;output_row.nma_pat = "";}&lt;BR /&gt;else { output_row.nom_pat = input_row.nom_pat;}&lt;/PRE&gt;&lt;BR /&gt;Does that do the trick?&lt;BR /&gt;Mike</description>
      <pubDate>Tue, 30 Dec 2008 15:26:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212676#M10218</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-30T15:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help for if - Else in tJavaRow</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212677#M10219</link>
      <description>Hi Mike,&lt;BR /&gt;i have try with "", and the result is the same, it's work the married name are put in "nom" collumn, but all other lines who haven't married name and just one name disappear.&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 30 Dec 2008 15:45:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212677#M10219</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-30T15:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help for if - Else in tJavaRow</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212678#M10220</link>
      <description>Hi,&lt;BR /&gt;I'm not sure to understand your need as well.&lt;BR /&gt;Do you have some sample input rows ? JobDesign screenshot ? some sample expected rows ?&lt;BR /&gt;Probably I'm wrong but I believe that you have made a complex job which don't seems so tricky.&lt;BR /&gt;&lt;BR /&gt;If you want try the Mike solution; try this: &lt;BR /&gt;&lt;PRE&gt;if (input_row.nma_pat != null &amp;amp;&amp;amp; !input_row.nma_pat.equals("")) {&lt;BR /&gt;output_row.nom_pat = input_row.nma_pat;&lt;BR /&gt;output_row.nma_pat = "";}&lt;BR /&gt;else { output_row.nom_pat = input_row.nom_pat;}&lt;/PRE&gt;&lt;BR /&gt;Best regards</description>
      <pubDate>Tue, 30 Dec 2008 15:46:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212678#M10220</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-30T15:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help for if - Else in tJavaRow</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212679#M10221</link>
      <description>Ho Yeah, it's works very well Cantoine ! Thanks you very much 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MAB6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/158321i00588DF41617C922/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MAB6.png" alt="0683p000009MAB6.png" /&gt;&lt;/span&gt; with your code, if input_row nma is not null, ouput_row.nom = input_row nma and now also for line where input_row nma is null i keep my ouptu_row.nom. I think you not understand yet, but tha'is right for me 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Now i must understand the difference with your code and Mike's code. 
&lt;BR /&gt;Thank you very much yet )</description>
      <pubDate>Tue, 30 Dec 2008 16:47:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212679#M10221</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-30T16:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help for if - Else in tJavaRow</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212680#M10222</link>
      <description>Hi,
&lt;BR /&gt;In java when you want test if a String is not null and not empty you have to use : myVar != null &amp;amp;&amp;amp; !myVar.equals("")
&lt;BR /&gt;myVar != null =&amp;gt; myVar not null
&lt;BR /&gt;!myVar.equals("") =&amp;gt; myVar is not empty
&lt;BR /&gt;myVar.equals("") =&amp;gt; myVar is empty
&lt;BR /&gt;Because Mike expression (myVar != "") works for Numeric or other data type but not for String.
&lt;BR /&gt;Best regards</description>
      <pubDate>Tue, 30 Dec 2008 17:03:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212680#M10222</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-30T17:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help for if - Else in tJavaRow</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212681#M10223</link>
      <description>Ok, i understand, rows who havent married name was null but not empty.&lt;BR /&gt;Best regards !</description>
      <pubDate>Tue, 30 Dec 2008 18:23:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212681#M10223</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-30T18:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help for if - Else in tJavaRow</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212682#M10224</link>
      <description>Hi,&lt;BR /&gt;actually, I'm selecting value&amp;nbsp;using simple Oracle query&amp;nbsp;in one of oraclecomponent toracleInput_1 in talend. The possible Output of this&amp;nbsp; query is 'Y'/'N'.&lt;BR /&gt;&amp;nbsp;I'd like to process further on value of 'Y' and want to raise error on value of 'N'. but the problem is - I don't know how to get value of previous component in Tdie_1 component or in warning component.&lt;BR /&gt;I want to Display message and want my Job to stop on value of 'N'. can you pls help me with code.</description>
      <pubDate>Thu, 28 Jan 2016 12:43:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212682#M10224</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-28T12:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help for if - Else in tJavaRow</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212683#M10225</link>
      <description>Can anyone pls help me on this?</description>
      <pubDate>Thu, 28 Jan 2016 15:17:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-Help-for-if-Else-in-tJavaRow/m-p/2212683#M10225</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-28T15:17:18Z</dc:date>
    </item>
  </channel>
</rss>

