<?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: If Statement: tMap Expression Builder in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273397#M50396</link>
    <description>Hi Andrew,
&lt;BR /&gt;Use a tJavaRow to take your incoming data flow and use the following:
&lt;BR /&gt;
&lt;PRE&gt;if(Integer.parseInt(input_row.CISR_VER) == 0)&lt;BR /&gt;{&lt;BR /&gt;	output_row.CISR_VER = "";&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;	Integer year = Integer.parseInt(input_row.CISR_VER.substring(0, 2));&lt;BR /&gt;	&lt;BR /&gt;	year += 1980;&lt;BR /&gt;	output_row.CISR_VER = input_row.CISR_VER.substring(2, 4) + "/" + year.toString();&lt;BR /&gt;}&lt;/PRE&gt;
&lt;BR /&gt;Note that you could do this inline within a tMap expression, but I've expanded it for clarity here.
&lt;BR /&gt;Cheers,
&lt;BR /&gt;c0utta</description>
    <pubDate>Wed, 15 Apr 2009 03:50:13 GMT</pubDate>
    <dc:creator>c0utta</dc:creator>
    <dc:date>2009-04-15T03:50:13Z</dc:date>
    <item>
      <title>If Statement: tMap Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273394#M50393</link>
      <description>I am trying to extract data from a database and build an expression to convert into the correct ouptut format, but i am having difficulty. My project is in Java. 
&lt;BR /&gt;The data is stored as 'string' values in the input database and is in the format: 
&lt;BR /&gt;CISR_VER 
&lt;BR /&gt;2605 
&lt;BR /&gt;2709 
&lt;BR /&gt;0 
&lt;BR /&gt;2803 
&lt;BR /&gt;3001 
&lt;BR /&gt;0 
&lt;BR /&gt;3002 
&lt;BR /&gt;Where the first 2 digits relate to the year (from a base of 1980) and the last two digits relate to the period/month (1 to 12). Therefore 2605 := Year 2006, Period 05...and 3002 := Year 2010, Period 02 and a 0 is blank or no data held. 
&lt;BR /&gt;The output i am trying to achieve is a column in the format 
&lt;BR /&gt;05/2006 
&lt;BR /&gt;09/2007 
&lt;BR /&gt;null or blank 
&lt;BR /&gt;03/2008 
&lt;BR /&gt;01/2010 
&lt;BR /&gt;null or blank 
&lt;BR /&gt;etc.... 
&lt;BR /&gt;I have a tMap that trims the last two digits and stores them in Var.Month (i can use the: Integer.parseInt(Var.Month) to convert to an integer) 
&lt;BR /&gt;I have another variable Var.Year that takes the first two digits, converts them into Integer format and adds 1980. 
&lt;BR /&gt;My problem is that where there is a zero in the input source i am getting a 1980 in the output where i need it to be blank/null. I have tried to build an IF function against the expression but cant seem to get the correct syntax. 
&lt;BR /&gt;Is there an easier way to do this in one expression that converts the input to an integer and can trim the digits and add the 1980 base year and add the '/'?? 
&lt;BR /&gt;Any help much appreciated!</description>
      <pubDate>Sat, 16 Nov 2024 13:59:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273394#M50393</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2024-11-16T13:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement: tMap Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273395#M50394</link>
      <description>I'm absolutly not sure that it is your problem but if you mean that you tried to insert an IF statement in the expression box, it won't work because the code isn't generated for it. You should create a new routine with the same java code and then it will work.</description>
      <pubDate>Tue, 14 Apr 2009 15:47:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273395#M50394</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-14T15:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement: tMap Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273396#M50395</link>
      <description>Basically all i need is the correct format of an If expression to test of Var.Year is 0 then dont insert anything into the tMap output column if Var.Year is greater than 0 then add 1980 to the value and insert the value in the output.
&lt;BR /&gt;Any Ideas?</description>
      <pubDate>Tue, 14 Apr 2009 20:10:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273396#M50395</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2009-04-14T20:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement: tMap Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273397#M50396</link>
      <description>Hi Andrew,
&lt;BR /&gt;Use a tJavaRow to take your incoming data flow and use the following:
&lt;BR /&gt;
&lt;PRE&gt;if(Integer.parseInt(input_row.CISR_VER) == 0)&lt;BR /&gt;{&lt;BR /&gt;	output_row.CISR_VER = "";&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;	Integer year = Integer.parseInt(input_row.CISR_VER.substring(0, 2));&lt;BR /&gt;	&lt;BR /&gt;	year += 1980;&lt;BR /&gt;	output_row.CISR_VER = input_row.CISR_VER.substring(2, 4) + "/" + year.toString();&lt;BR /&gt;}&lt;/PRE&gt;
&lt;BR /&gt;Note that you could do this inline within a tMap expression, but I've expanded it for clarity here.
&lt;BR /&gt;Cheers,
&lt;BR /&gt;c0utta</description>
      <pubDate>Wed, 15 Apr 2009 03:50:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273397#M50396</guid>
      <dc:creator>c0utta</dc:creator>
      <dc:date>2009-04-15T03:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement: tMap Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273398#M50397</link>
      <description>Many Thanks c0utta!&lt;BR /&gt;Worked like a charm.  I didnt know that a tJavaRow was even possible.</description>
      <pubDate>Wed, 15 Apr 2009 13:28:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273398#M50397</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2009-04-15T13:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement: tMap Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273399#M50398</link>
      <description>I am trying to use a Var during using a tMap for this and getting an error:
&lt;BR /&gt;'Syntax error on token(s), misplaced construct(s)'
&lt;BR /&gt;This is my structure:
&lt;BR /&gt;OUT_Table:
&lt;BR /&gt;id
&lt;BR /&gt;name
&lt;BR /&gt;OUT_Table.name -&amp;gt; Var where this is being called
&lt;BR /&gt;if(Integer.parseInt(name.OUT_Table) == 0) {
&lt;BR /&gt; Var.var1 = null;
&lt;BR /&gt;} else {
&lt;BR /&gt; Var.var1 = name.OUT_Table;
&lt;BR /&gt;}
&lt;BR /&gt;Then it will go out of the that Var and into the IN_Table
&lt;BR /&gt;When I try to run this, i get the error: 'Syntax error on token(s), misplaced construct(s)'
&lt;BR /&gt;Thanks.
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;Hi Andrew,&lt;BR /&gt;Use a tJavaRow to take your incoming data flow and use the following:&lt;BR /&gt;&lt;PRE&gt;if(Integer.parseInt(input_row.CISR_VER) == 0)&lt;BR /&gt;{&lt;BR /&gt;	output_row.CISR_VER = "";&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;	Integer year = Integer.parseInt(input_row.CISR_VER.substring(0, 2));&lt;BR /&gt;	&lt;BR /&gt;	year += 1980;&lt;BR /&gt;	output_row.CISR_VER = input_row.CISR_VER.substring(2, 4) + "/" + year.toString();&lt;BR /&gt;}&lt;/PRE&gt;&lt;BR /&gt;Note that you could do this inline within a tMap expression, but I've expanded it for clarity here.&lt;BR /&gt;Cheers,&lt;BR /&gt;c0utta&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 18 Aug 2010 14:33:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273399#M50398</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-08-18T14:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement: tMap Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273400#M50399</link>
      <description>c0utta, i don't understant your affermation: "Note that you could do this inline within a tMap expression, but I've expanded it for clarity here." 
&lt;BR /&gt;I've tryed tjavaRow component and it accepts the common if java statement. 
&lt;BR /&gt;In tMap component in the Expression I'm able only to use the java statement -&amp;gt; Condizion?True:False.. the if statement isn't compiled.. 
&lt;BR /&gt;It's right?</description>
      <pubDate>Thu, 12 May 2011 10:31:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273400#M50399</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2011-05-12T10:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement: tMap Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273401#M50400</link>
      <description>Yes but you can use the java statement to do it, just put that in the Expression of your output column : 
&lt;BR /&gt;Integer.parseInt(row1.CISR_VER) == 0?"" 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt;row1.CISR_VER.substring(2,4) + "/" + ((Integer)(Integer.parseInt(row1.CISR_VER.substring(0, 2)) + 1980)).toString()) 
&lt;BR /&gt;It's a little bit more tricky I agree &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Wed, 18 May 2011 16:38:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273401#M50400</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-18T16:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement: tMap Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273402#M50401</link>
      <description>Why not just have 
&lt;BR /&gt;row1.CISR_VER.equals("0")?"" 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt;row1.CISR_VER.substring(2,4) + "/" + ((Integer)(Integer.parseInt(row1.CISR_VER.substring(0, 2)) + 1980)).toString())</description>
      <pubDate>Wed, 18 May 2011 16:45:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273402#M50401</guid>
      <dc:creator>janhess</dc:creator>
      <dc:date>2011-05-18T16:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement: tMap Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273403#M50402</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;Yes but you can use the java statement to do it, just put that in the Expression of your output column :&lt;BR /&gt;Integer.parseInt(row1.CISR_VER) == 0?""&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt;row1.CISR_VER.substring(2,4) + "/" + ((Integer)(Integer.parseInt(row1.CISR_VER.substring(0, 2)) + 1980)).toString()) &lt;BR /&gt;It's a little bit more tricky I agree &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;"==" sintax does not work. 
&lt;BR /&gt;".equals" sintax does work. 
&lt;BR /&gt;Why do you suggest "=="?</description>
      <pubDate>Fri, 29 Mar 2013 15:12:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273403#M50402</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-29T15:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement: tMap Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273404#M50403</link>
      <description>This seems close to what I need to do and for some reason I can't quite massage it for my purposes. 
&lt;BR /&gt;Our records coming in have a net available and warehouse. 
&lt;BR /&gt;Example 
&lt;BR /&gt;Product | Warehouse | Qty 
&lt;BR /&gt;--------------------------------------------- 
&lt;BR /&gt;Gizmo | Paris | 3 
&lt;BR /&gt;Gizmo | London | 7 
&lt;BR /&gt;Widget | Paris | 6 
&lt;BR /&gt;Widget | London | 4 
&lt;BR /&gt; 
&lt;BR /&gt;The inventory record in the outbound table has a field for each warehouse which contains the qty available at that location. 
&lt;BR /&gt;Example: 
&lt;BR /&gt;Product | Paris | London 
&lt;BR /&gt;----------------------------- 
&lt;BR /&gt;Widget | 6 | 4 
&lt;BR /&gt;Gizmo | 3 | 7 
&lt;BR /&gt;I want to populate the Paris field with inventory from Paris and the London field with inventory from London. (And no, I did NOT design this stupid table) 
&lt;BR /&gt;So I have something like this in the expression in my tmap 
&lt;BR /&gt;if (row2.whse=="Paris) inventory.Paris = row2.netavailable 
&lt;BR /&gt;but it doesn't like it. 
&lt;BR /&gt;Where am I going wrong?</description>
      <pubDate>Mon, 01 Apr 2013 21:35:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273404#M50403</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2013-04-01T21:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement: tMap Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273405#M50404</link>
      <description>Hi Everyone,&lt;BR /&gt;I have a text "tab" delimited file in which i have data as per the below given syntax:&lt;BR /&gt;"PCS"	"CAMPAIGN_CYCLE_ID"	"TREATMENT_ID"&lt;BR /&gt;4803000000	13143	1063362&lt;BR /&gt;6143000000	13143	1063362&lt;BR /&gt;8136000000	13143	1063361&lt;BR /&gt;6264000000	13143	1063361&lt;BR /&gt;I would like to make two text files with PCS having unique TREATMENT_ID that will be something like this:&lt;BR /&gt;File1&lt;BR /&gt;"PCS"	"CAMPAIGN_CYCLE_ID"	"TREATMENT_ID"&lt;BR /&gt;4803000000	13143	1063362&lt;BR /&gt;6143000000	13143	1063362&lt;BR /&gt;File2&lt;BR /&gt;"PCS"	"CAMPAIGN_CYCLE_ID"	"TREATMENT_ID"&lt;BR /&gt;8136000000	13143	1063361&lt;BR /&gt;6264000000	13143	1063361&lt;BR /&gt;I have the input file in place in my job, then i have tmap but i cant write the concern code in it, so that i have two different files for PCS with uniques Treatment_ID.&lt;BR /&gt;Your help will be a savior.&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 02 Jul 2013 18:02:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273405#M50404</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2013-07-02T18:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement: tMap Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273406#M50405</link>
      <description>Hi Abhimanyu, 
&lt;BR /&gt;Do you want to separate your input source into two output files depending on the different "TREATMENT_ID"? If so, you can set a filter in tMap. 
&lt;BR /&gt;See my screenshots for details 
&lt;BR /&gt;In addition, there are related articles about 
&lt;A href="https://help.talend.com/display/TalendDataServicesStudioUserGuide53EN/9.2+tMap+operation" target="_blank" rel="nofollow noopener noreferrer"&gt;tMap+operation&lt;/A&gt;, 
&lt;A href="https://help.talend.com/display/TalendComponentsReferenceGuide53EN/tMap" target="_blank" rel="nofollow noopener noreferrer"&gt;tMap&lt;/A&gt; and 
&lt;A href="https://help.talend.com/display/TalendDataServicesStudioUserGuide53EN/B.1++tMap+Job+example" target="_blank" rel="nofollow noopener noreferrer"&gt;tMap+Job+example&lt;/A&gt;, hope it will be useful for your further job. 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Sabrina 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MADg.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/146430i198F3081BE32B8F4/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MADg.jpg" alt="0683p000009MADg.jpg" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MADl.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/130387iA3AC0D0A6D94483D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MADl.jpg" alt="0683p000009MADl.jpg" /&gt;&lt;/span&gt;</description>
      <pubDate>Wed, 03 Jul 2013 04:12:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273406#M50405</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-03T04:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement: tMap Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273407#M50406</link>
      <description>I'm also having problems with the tMap and expressions. My Java isn't all that great but I passed it to a colleague and he thinks the actual Java should be fine.
&lt;BR /&gt;I'm attempting a simple ETL job to better clean the data for easier profiling (the DB is a bit of a mess) and I was using a tMap with expressions such as:
&lt;BR /&gt;
&lt;PRE&gt;if (row1.EanCode == null &amp;amp;&amp;amp; row1.EAN_Required == 'N') {&lt;BR /&gt;	Out.EanCode = 'Not Required';&lt;BR /&gt;} else {&lt;BR /&gt;	Out.EanCode = row1.EanCode;&lt;BR /&gt;}&lt;/PRE&gt;
&lt;BR /&gt;and:
&lt;BR /&gt;
&lt;PRE&gt;if (row1.Weight.compareTo(BigDecimal.ZERO) == 0 &amp;amp;&amp;amp; row1.Weight_Required == 'N') {&lt;BR /&gt;	Out.Weight = 0;&lt;BR /&gt;} else if (row1.Weight.compareTo(BigDecimal.ZERO) == 0 &amp;amp;&amp;amp; row1.Weight_Required == 'Y') {&lt;BR /&gt;	Out.Weight = null;&lt;BR /&gt;} else {&lt;BR /&gt;	Out.Weight = row1.Weight;&lt;BR /&gt;}&lt;/PRE&gt;
&lt;BR /&gt;and finally:
&lt;BR /&gt;
&lt;PRE&gt;if (Out.EanCode != null &amp;amp;&amp;amp; Out.Supplier_Product_Code != null &amp;amp;&amp;amp; Out.Weight != null &amp;amp;&amp;amp; Out.Single_Length != null) {&lt;BR /&gt;	Out2.Data_Quality_Level = "Blue";&lt;BR /&gt;} else {&lt;BR /&gt;	Out2.Data_Quality_Level = "Red";&lt;BR /&gt;}&lt;/PRE&gt;
&lt;BR /&gt;I'm getting "Syntax error on token(s), misplaced construct(s)", "Invalid character constant" and "Syntax error on token '=', Expression expected after this token" errors back when I run this job although when I look at the underlying code that Talend generates it appears to be finding some fault with some of the code it has generated that precedes my conditional code:
&lt;BR /&gt;
&lt;PRE&gt;Out_tmp.EanCode = if (row1.EanCode == null &amp;amp;&amp;amp; row1.EAN_Required == 'N') {&lt;BR /&gt;	Out.EanCode = 'Not Required';&lt;BR /&gt;} else {&lt;BR /&gt;	Out.EanCode = row1.EanCode;&lt;BR /&gt;} ;&lt;/PRE&gt;
&lt;BR /&gt;With a syntax error on the "Out_tmp.EanCode =" part.
&lt;BR /&gt;What do I need to do to get this to work?</description>
      <pubDate>Fri, 09 Aug 2013 14:43:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273407#M50406</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-09T14:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement: tMap Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273408#M50407</link>
      <description>if (row1.EanCode == null &amp;amp;&amp;amp; row1.EAN_Required == 'N') {
&lt;BR /&gt; Out.EanCode = 'Not Required';
&lt;BR /&gt;} else {
&lt;BR /&gt; Out.EanCode = row1.EanCode;
&lt;BR /&gt;}
&lt;BR /&gt;is the Java syntax you would use if writing your own code e.g. in a tJava or tJavaRow.
&lt;BR /&gt;But tMap already generates the "Out.EanCode = " part of the statement for you. What you provide as the tMap expression is only what appears on the right-hand side of that statement (excluding the semi-colon) e.g. "Not Required" or row1.EanCode. That is why you're seeing code like:
&lt;BR /&gt;Out_tmp.EanCode = if (row1.EanCode == null &amp;amp;&amp;amp; row1.EAN_Required == 'N') {
&lt;BR /&gt; Out.EanCode = 'Not Required';
&lt;BR /&gt;} else {
&lt;BR /&gt; Out.EanCode = row1.EanCode;
&lt;BR /&gt;} ;
&lt;BR /&gt;but that is not valid syntax since you can't have an assign statement or if conditions inside an assign statement.
&lt;BR /&gt;To use if-then-else logic in a tMap expression, the correct syntax is:
&lt;BR /&gt;row1.EanCode == null &amp;amp;&amp;amp; row1.EAN_Required == 'N' ? 'Not Required' : row1.EanCode</description>
      <pubDate>Sun, 11 Aug 2013 03:56:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273408#M50407</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2013-08-11T03:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement: tMap Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273409#M50408</link>
      <description>Ah that makes more sense. I'm still not used to being able to see the code that Talend is generating and I know very little about Java right now so still get caught up on things.
&lt;BR /&gt;Thanks for pointing out that I should be using ternarys in the tMap.</description>
      <pubDate>Wed, 21 Aug 2013 09:23:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273409#M50408</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-21T09:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement: tMap Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273410#M50409</link>
      <description>Hola a todos:
&lt;BR /&gt;Soy nuevo en talend y estoy enfrentando un error el cual no he podido resolver, 
&lt;BR /&gt;Estoy usando un Tmap para hacer una sentencia IF, mi sentencia es 
&lt;BR /&gt;if(StringHandling.UPCASE(StringHandling.LEFT(row3.Linea_Limpia,8))=="USERNAME") row4.Usuario="SI"; else row4.Usuario="NO";
&lt;BR /&gt;Donde row3.Linea_Limpia es la ENTRADA al Tmap y la SALIDA esta en row4.Usuario. La sentencia la estoy colocando en la expresion de row4 el cual corresponde a la salida
&lt;BR /&gt;cuando lo compilo me sale este error, Syntax error on token(s), misplaced construct(s)</description>
      <pubDate>Tue, 24 Nov 2015 13:53:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273410#M50409</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-24T13:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement: tMap Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273411#M50410</link>
      <description>Hi Williampineda11, 
&lt;BR /&gt;This is an international forum and English is the language we use. Posting in English will allow you to get more visibility and more help. Thanks for your understanding! 
&lt;BR /&gt; 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Sabrina</description>
      <pubDate>Wed, 25 Nov 2015 08:11:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273411#M50410</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-25T08:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement: tMap Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273412#M50411</link>
      <description>IIF ( (ISNULL(LE_CD) AND (MD_SOURCE_SYSTEM_O='15' OR MD_SOURCE_SYSTEM_O ='16')), OPERATING_UNIT_ID,&amp;nbsp;&lt;BR /&gt;IIF ( (ISNULL(LE_CD) AND (MD_SOURCE_SYSTEM_O = '25' OR MD_SOURCE_SYSTEM_O = '28' OR MD_SOURCE_SYSTEM_O = '27')),&lt;BR /&gt;IIF(INSTR(OPERATING_UNIT_NAME_INV_LINE,'-',1) &amp;gt; 0, SUBSTR(OPERATING_UNIT_NAME_INV_LINE,1,(INSTR(OPERATING_UNIT_NAME_INV_LINE,'-',1)- 1))),&amp;nbsp;&lt;BR /&gt;LE_CD))---how to write this in talned</description>
      <pubDate>Tue, 26 Apr 2016 13:23:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273412#M50411</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-26T13:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement: tMap Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273413#M50412</link>
      <description>Hi,&lt;BR /&gt;For null check I need to add manually the condition to each and every column in tmap. I find it is difficult if we have 100+ columns.&lt;BR /&gt;So can any one suggest how to add null check globally for all the columns. Is talend have that feature?&amp;nbsp;&lt;BR /&gt;I am in urgent with req. Please help.</description>
      <pubDate>Fri, 17 Feb 2017 12:45:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/If-Statement-tMap-Expression-Builder/m-p/2273413#M50412</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2017-02-17T12:45:57Z</dc:date>
    </item>
  </channel>
</rss>

