<?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: dynamically determine column names in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/dynamically-determine-column-names/m-p/2220436#M14833</link>
    <description>&lt;P&gt;Assuming you have limited (4 in this example) parameters to search for&lt;BR /&gt;Assuming your excel entries are hortizontally sequential and there is no gap in between, meaning your entry should not look like Column C is filled, Column D is empty, Column E is filled&lt;BR /&gt;1) You would call the connector link that flows after xmlextract as say carryfwdxl, this is to ensure that your links are not named as row1, row2 as these numbers might change on disconnecting and reconnecting&lt;BR /&gt;2) You would reconstruct the lookup file as Column A, Column B, Column c+ Column D+ Column E+.....Column n, i would call them hypothetically as col1, col2 and col3&lt;BR /&gt;3) You would need 4 lookups to the configuration file (Excel in this example)&lt;BR /&gt;First lookup would match the division number and product number on col1 and col2 and return col3&lt;BR /&gt;Second lookup would match the division number and ItemNumber on col1 and col2 and return col3&lt;BR /&gt;Third lookup would match the division number and ColorName on col1 and col2 and return col3&lt;BR /&gt;Fourth lookup would match the division number and ColorCode on col1 and col2 and return col3&lt;BR /&gt;&lt;BR /&gt;Your return values from each of these lookups would look like DIVISIONNAME+CUSTOMNAME etcnow do a quick replace of + with "carryfwdxl."+, so the resultant value should look like&lt;BR /&gt;carryfwdxl.DIVISIONNAME+carryfwdxl.CUSTOMNAME. You can always insert spaces as you need in between these values&lt;BR /&gt;&lt;BR /&gt;On the other hand if you too many parameters like product number, item number etc and if those keep growing or changing then i would suggest have a cartesian product prebuilt and lookup that data set, which i guess is not likely in your case.&lt;/P&gt; 
&lt;P&gt;Hope that helps&lt;/P&gt;</description>
    <pubDate>Wed, 18 Dec 2019 01:48:56 GMT</pubDate>
    <dc:creator>tnewbie</dc:creator>
    <dc:date>2019-12-18T01:48:56Z</dc:date>
    <item>
      <title>dynamically determine column names</title>
      <link>https://community.qlik.com/t5/Talend-Studio/dynamically-determine-column-names/m-p/2220435#M14832</link>
      <description>&lt;P&gt;Hi&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am trying to figure out how I can use 2 source files to produce a data that I can save to a database table (MySQL). The issue is that 1 file (XML) has the actual data but the second one (Excel) is a mapping of what fields should be used in the XML. Below is an example of what I have as a source files:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;XML file:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="product_xml.PNG" style="width: 630px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8F7.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140897i16E96A558E6890C5/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8F7.png" alt="0683p000009M8F7.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;Excel File:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ProductMapping_xlsx.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8NU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/130654i441BD11583FC3C5A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8NU.png" alt="0683p000009M8NU.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;BR /&gt;When I process the XML I should match the DIVISIONNUMBER in the XML with the Division in the spreadsheet. Then get the data for defined DBTargetColumns from XMLSourceColumns (concatenate them all with a space as a delimiter character).&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;For example, based on the above sample files the logic should follow this rule for Division 03:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;ProductName = DIVISIONNAME + " " + ITEMNAME&lt;/P&gt; 
&lt;P&gt;ItemNumber = ITEMNO&lt;/P&gt; 
&lt;P&gt;ColorName = COLORNAME&lt;/P&gt; 
&lt;P&gt;ColorCode = COLORCODE&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;And this will be the actual data result:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;ProductName = "Division03 Product1 Name"&lt;/P&gt; 
&lt;P&gt;ItemNumber = "Product1"&lt;/P&gt; 
&lt;P&gt;ColorName = "BLACK"&lt;/P&gt; 
&lt;P&gt;ColorCode = "BK"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;And then for Division 10 this would be the rule:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;ProductName = DIVISIONNAME + " " + CUSTOMNAME + " " + ITEMNAME&lt;/P&gt; 
&lt;P&gt;ItemNumber = DIVISIONNUMBER + " " + ITEMNO&lt;/P&gt; 
&lt;P&gt;ColorName = CUSTOMCOLORNAME&lt;/P&gt; 
&lt;P&gt;ColorCode = DIVISIONNUMBER + " " + COLORCODE&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The expected result:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;ProductName = "Division10 Prod2 Alt. Name Product2 Name"&lt;/P&gt; 
&lt;P&gt;ItemNumber = "10 Product2"&lt;/P&gt; 
&lt;P&gt;ColorName = "RD Custom"&lt;/P&gt; 
&lt;P&gt;ColorCode = "10 R"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'd appreciate any help with this problem.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:47:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/dynamically-determine-column-names/m-p/2220435#M14832</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T03:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: dynamically determine column names</title>
      <link>https://community.qlik.com/t5/Talend-Studio/dynamically-determine-column-names/m-p/2220436#M14833</link>
      <description>&lt;P&gt;Assuming you have limited (4 in this example) parameters to search for&lt;BR /&gt;Assuming your excel entries are hortizontally sequential and there is no gap in between, meaning your entry should not look like Column C is filled, Column D is empty, Column E is filled&lt;BR /&gt;1) You would call the connector link that flows after xmlextract as say carryfwdxl, this is to ensure that your links are not named as row1, row2 as these numbers might change on disconnecting and reconnecting&lt;BR /&gt;2) You would reconstruct the lookup file as Column A, Column B, Column c+ Column D+ Column E+.....Column n, i would call them hypothetically as col1, col2 and col3&lt;BR /&gt;3) You would need 4 lookups to the configuration file (Excel in this example)&lt;BR /&gt;First lookup would match the division number and product number on col1 and col2 and return col3&lt;BR /&gt;Second lookup would match the division number and ItemNumber on col1 and col2 and return col3&lt;BR /&gt;Third lookup would match the division number and ColorName on col1 and col2 and return col3&lt;BR /&gt;Fourth lookup would match the division number and ColorCode on col1 and col2 and return col3&lt;BR /&gt;&lt;BR /&gt;Your return values from each of these lookups would look like DIVISIONNAME+CUSTOMNAME etcnow do a quick replace of + with "carryfwdxl."+, so the resultant value should look like&lt;BR /&gt;carryfwdxl.DIVISIONNAME+carryfwdxl.CUSTOMNAME. You can always insert spaces as you need in between these values&lt;BR /&gt;&lt;BR /&gt;On the other hand if you too many parameters like product number, item number etc and if those keep growing or changing then i would suggest have a cartesian product prebuilt and lookup that data set, which i guess is not likely in your case.&lt;/P&gt; 
&lt;P&gt;Hope that helps&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 01:48:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/dynamically-determine-column-names/m-p/2220436#M14833</guid>
      <dc:creator>tnewbie</dc:creator>
      <dc:date>2019-12-18T01:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: dynamically determine column names</title>
      <link>https://community.qlik.com/t5/Talend-Studio/dynamically-determine-column-names/m-p/2220437#M14834</link>
      <description>&lt;P&gt;Thanks for your reply. Could you clarify where the lookup should be performed? Do I use a tMap or something else?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 14:33:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/dynamically-determine-column-names/m-p/2220437#M14834</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-18T14:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: dynamically determine column names</title>
      <link>https://community.qlik.com/t5/Talend-Studio/dynamically-determine-column-names/m-p/2220438#M14835</link>
      <description>&lt;P&gt;Yes...lookup using Tmap&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2019 05:33:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/dynamically-determine-column-names/m-p/2220438#M14835</guid>
      <dc:creator>tnewbie</dc:creator>
      <dc:date>2019-12-20T05:33:29Z</dc:date>
    </item>
  </channel>
</rss>

