<?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 How to display two fields from the input files in Talend Data Catalog</title>
    <link>https://community.qlik.com/t5/Talend-Data-Catalog/How-to-display-two-fields-from-the-input-files/m-p/2326478#M492</link>
    <description>&lt;P&gt;Hi members, in a big project, I have to map two fields correctly from the input to output:&lt;/P&gt; 
&lt;P&gt;- The first field in the output is named "&lt;STRONG&gt;attribute_PSS_Comment&lt;/STRONG&gt;" and it contains the concatenation of three fields from the input which are: "&lt;STRONG&gt;attribute_FPDMISBGCOMMENT_1&lt;/STRONG&gt;", "&lt;STRONG&gt;attribute_FPDMISBGCOMMENT_2&lt;/STRONG&gt;" and "&lt;STRONG&gt;attribute_PSS_FPDM_POC_Recommended_Family&lt;/STRONG&gt;".&lt;/P&gt; 
&lt;P&gt;- The second field in the output is named "&lt;STRONG&gt;attribute_PSS_SAPDescription&lt;/STRONG&gt;" and it is mapped with "&lt;STRONG&gt;attribute_FPDMSAPDescription&lt;/STRONG&gt;" of the input. The "&lt;STRONG&gt;attribute_FPDMSAPDescription" &lt;/STRONG&gt;is also mapped with &lt;STRONG&gt;"attribute_PSS_ManufacturingItemExt_PSS_FaureciaShortLengthDescriptionFCS" &lt;/STRONG&gt;in the output.&lt;/P&gt; 
&lt;P&gt;The creation of the fields is done in the component "tJavaRow_15" as following:&lt;/P&gt; 
&lt;PRE&gt;Field attributes = output_row.getClass().getDeclaredField("attributes");
Field attributes1 = output_row.getClass().getDeclaredField("attributes1");
//if(!(String.valueOf(input_row.getClass().getField("name").get(input_row))).startsWith("CM-")){
	Set&amp;lt;String&amp;gt; set1=((Map&amp;lt;String,String&amp;gt;)globalMap.get("colHeaderMaterialBO")).keySet();
	//System.out.println("OKKKKK" + (Map&amp;lt;String,String&amp;gt;)globalMap.get("colHeaderMaterialBO"));       
	boolean first = true;

	int index = 12;
	
	String concat="";
	String concat1="";
	
for(String str:set1){

      String cellName = str ;
      String cellValue = (input_row.getClass().getField(((Map&amp;lt;String,String&amp;gt;)globalMap.get("colHeaderMaterialBO")).get(cellName)).get(input_row).toString());
//      System.out.println(((String)globalMap.get("tFileList_5_CURRENT_FILEPATH"))+"\n"+cellName + "-&amp;gt; "+cellValue);      
	if(cellName.equals("attribute_FPDMISBGCOMMENT_1") || cellName.equals("attribute_FPDMISBGCOMMENT_2") || cellName.equals("attribute_PSS_FPDM_POC_Recommended_Family")){
		if ("".equalsIgnoreCase(concat)){
			concat = cellValue;
		}else{
			if (!("".equals(cellValue))){
				concat = concat +" - "+ cellValue;
			}
		}
	}
	if(cellName.equals("attribute_FPDMSAPDescription")){
		if ("".equalsIgnoreCase(concat1)){
			concat1 = cellValue;
		}else{
			if (!("".equals(cellValue))){
				concat1 = concat1 +" - "+ cellValue;
			}
		}
	}
	
		
	
      try {
            Field out=output_row.getClass().getDeclaredField(cellName);
            if(cellName.equals("key")){
            	out.set(output_row, Integer.parseInt(cellValue));
			}
			else {
            	out.set(output_row, cellValue);
            }
      } catch (NoSuchFieldException nsfe) {
			Field fld = output_row.getClass().getDeclaredField("newColumn"+index);
            fld.set(output_row, cellValue);
            index++;
 
     }
}
//}
if (concat.length()&amp;gt;=40){
	attributes.set(output_row,""+concat.substring(0, 40));
}else{
	attributes.set(output_row,""+concat);
}

if (concat1.length()&amp;gt;=40){
	attributes1.set(output_row,""+concat1.substring(0, 40));
}else{
	attributes1.set(output_row,""+concat1);
}&lt;/PRE&gt; 
&lt;P&gt;and in the following tMap named tMap_7, the mapping id done as following:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ccccccccc.PNG" style="width: 984px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8GT.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154529i5D2A9C0D19B0DD31/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8GT.png" alt="0683p000009M8GT.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="capcapcap.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7rn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/149302iD95827D74533CDE3/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7rn.png" alt="0683p000009M7rn.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ddddddd.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8GY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140446iB31E1F23B6646BEF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8GY.png" alt="0683p000009M8GY.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 04:01:06 GMT</pubDate>
    <dc:creator>Hajar1</dc:creator>
    <dc:date>2024-11-16T04:01:06Z</dc:date>
    <item>
      <title>How to display two fields from the input files</title>
      <link>https://community.qlik.com/t5/Talend-Data-Catalog/How-to-display-two-fields-from-the-input-files/m-p/2326478#M492</link>
      <description>&lt;P&gt;Hi members, in a big project, I have to map two fields correctly from the input to output:&lt;/P&gt; 
&lt;P&gt;- The first field in the output is named "&lt;STRONG&gt;attribute_PSS_Comment&lt;/STRONG&gt;" and it contains the concatenation of three fields from the input which are: "&lt;STRONG&gt;attribute_FPDMISBGCOMMENT_1&lt;/STRONG&gt;", "&lt;STRONG&gt;attribute_FPDMISBGCOMMENT_2&lt;/STRONG&gt;" and "&lt;STRONG&gt;attribute_PSS_FPDM_POC_Recommended_Family&lt;/STRONG&gt;".&lt;/P&gt; 
&lt;P&gt;- The second field in the output is named "&lt;STRONG&gt;attribute_PSS_SAPDescription&lt;/STRONG&gt;" and it is mapped with "&lt;STRONG&gt;attribute_FPDMSAPDescription&lt;/STRONG&gt;" of the input. The "&lt;STRONG&gt;attribute_FPDMSAPDescription" &lt;/STRONG&gt;is also mapped with &lt;STRONG&gt;"attribute_PSS_ManufacturingItemExt_PSS_FaureciaShortLengthDescriptionFCS" &lt;/STRONG&gt;in the output.&lt;/P&gt; 
&lt;P&gt;The creation of the fields is done in the component "tJavaRow_15" as following:&lt;/P&gt; 
&lt;PRE&gt;Field attributes = output_row.getClass().getDeclaredField("attributes");
Field attributes1 = output_row.getClass().getDeclaredField("attributes1");
//if(!(String.valueOf(input_row.getClass().getField("name").get(input_row))).startsWith("CM-")){
	Set&amp;lt;String&amp;gt; set1=((Map&amp;lt;String,String&amp;gt;)globalMap.get("colHeaderMaterialBO")).keySet();
	//System.out.println("OKKKKK" + (Map&amp;lt;String,String&amp;gt;)globalMap.get("colHeaderMaterialBO"));       
	boolean first = true;

	int index = 12;
	
	String concat="";
	String concat1="";
	
for(String str:set1){

      String cellName = str ;
      String cellValue = (input_row.getClass().getField(((Map&amp;lt;String,String&amp;gt;)globalMap.get("colHeaderMaterialBO")).get(cellName)).get(input_row).toString());
//      System.out.println(((String)globalMap.get("tFileList_5_CURRENT_FILEPATH"))+"\n"+cellName + "-&amp;gt; "+cellValue);      
	if(cellName.equals("attribute_FPDMISBGCOMMENT_1") || cellName.equals("attribute_FPDMISBGCOMMENT_2") || cellName.equals("attribute_PSS_FPDM_POC_Recommended_Family")){
		if ("".equalsIgnoreCase(concat)){
			concat = cellValue;
		}else{
			if (!("".equals(cellValue))){
				concat = concat +" - "+ cellValue;
			}
		}
	}
	if(cellName.equals("attribute_FPDMSAPDescription")){
		if ("".equalsIgnoreCase(concat1)){
			concat1 = cellValue;
		}else{
			if (!("".equals(cellValue))){
				concat1 = concat1 +" - "+ cellValue;
			}
		}
	}
	
		
	
      try {
            Field out=output_row.getClass().getDeclaredField(cellName);
            if(cellName.equals("key")){
            	out.set(output_row, Integer.parseInt(cellValue));
			}
			else {
            	out.set(output_row, cellValue);
            }
      } catch (NoSuchFieldException nsfe) {
			Field fld = output_row.getClass().getDeclaredField("newColumn"+index);
            fld.set(output_row, cellValue);
            index++;
 
     }
}
//}
if (concat.length()&amp;gt;=40){
	attributes.set(output_row,""+concat.substring(0, 40));
}else{
	attributes.set(output_row,""+concat);
}

if (concat1.length()&amp;gt;=40){
	attributes1.set(output_row,""+concat1.substring(0, 40));
}else{
	attributes1.set(output_row,""+concat1);
}&lt;/PRE&gt; 
&lt;P&gt;and in the following tMap named tMap_7, the mapping id done as following:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ccccccccc.PNG" style="width: 984px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8GT.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154529i5D2A9C0D19B0DD31/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8GT.png" alt="0683p000009M8GT.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="capcapcap.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7rn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/149302iD95827D74533CDE3/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7rn.png" alt="0683p000009M7rn.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ddddddd.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8GY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140446iB31E1F23B6646BEF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8GY.png" alt="0683p000009M8GY.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:01:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Data-Catalog/How-to-display-two-fields-from-the-input-files/m-p/2326478#M492</guid>
      <dc:creator>Hajar1</dc:creator>
      <dc:date>2024-11-16T04:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to display two fields from the input files</title>
      <link>https://community.qlik.com/t5/Talend-Data-Catalog/How-to-display-two-fields-from-the-input-files/m-p/2326479#M493</link>
      <description>Hi ha_2019
&lt;BR /&gt;I think I don't understand your question well, what is your issue and what do you expect?
&lt;BR /&gt;
&lt;BR /&gt;Regards
&lt;BR /&gt;Shong
&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Nov 2019 01:40:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Data-Catalog/How-to-display-two-fields-from-the-input-files/m-p/2326479#M493</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-29T01:40:36Z</dc:date>
    </item>
  </channel>
</rss>

