<?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: Mapping output columns in txmlmap based on conditions from table in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Mapping-output-columns-in-txmlmap-based-on-conditions-from-table/m-p/2234378#M23765</link>
    <description>I am getting an XML payload which has many tags. I need to search one of the values from a tag and compare it with a &amp;nbsp;table in mssql database . Based on the value in the table that gets matched with this tag value I need to move one node from the xml ahead for further processing.for a different value found in table I need to map another xml node 
&lt;BR /&gt;Eg consider xml file i have input to txmlmap is&amp;nbsp; 
&lt;BR /&gt;... 
&lt;BR /&gt;&amp;lt;amt&amp;gt;12&amp;lt;/amt&amp;gt; 
&lt;BR /&gt;&amp;lt;foreignamt&amp;gt;78&amp;lt;/foreignamt&amp;gt; 
&lt;BR /&gt;&amp;lt;currency&amp;gt;USD&amp;lt;/currency&amp;gt; 
&lt;BR /&gt;... 
&lt;BR /&gt;Now i need to map this xml to a different output xml with structure like 
&lt;BR /&gt;.. 
&lt;BR /&gt;&amp;lt;currency&amp;gt;USD&amp;lt;/currency&amp;gt; 
&lt;BR /&gt;&amp;lt;outputamt&amp;gt;&amp;lt;/outputamt&amp;gt; 
&lt;BR /&gt;... 
&lt;BR /&gt;(I have extracted the relevant xml structure ..the actual xml is much bigger) 
&lt;BR /&gt;However before that i need to check the currency value from the input xml. 
&lt;BR /&gt;I need to extract the currency value and compare it against a database table with structure like below 
&lt;BR /&gt;create table currency_switch 
&lt;BR /&gt;(currency char(10), 
&lt;BR /&gt;&amp;nbsp;output_value char(1) ) 
&lt;BR /&gt;This table will have rows like 
&lt;BR /&gt;currency output_value 
&lt;BR /&gt;USD &amp;nbsp; &amp;nbsp; &amp;nbsp;A 
&lt;BR /&gt;EURO &amp;nbsp; &amp;nbsp; F 
&lt;BR /&gt;GBP &amp;nbsp; &amp;nbsp; &amp;nbsp;F 
&lt;BR /&gt;AUD &amp;nbsp; &amp;nbsp; &amp;nbsp;A 
&lt;BR /&gt;Thus if the currency value from input xml is &amp;nbsp;USD/AUD i need to map &amp;lt;amount&amp;gt;12&amp;lt;/amount&amp;gt; to the output column&amp;nbsp; 
&lt;BR /&gt;outputamt. If the currency value is EURO/GBP..then i need to map foreignamt which is 78 in this example to output column&amp;nbsp; 
&lt;BR /&gt;outputamt..</description>
    <pubDate>Wed, 29 Apr 2015 09:26:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-04-29T09:26:01Z</dc:date>
    <item>
      <title>Mapping output columns in txmlmap based on conditions from table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Mapping-output-columns-in-txmlmap-based-on-conditions-from-table/m-p/2234376#M23763</link>
      <description>I am getting an XML payload which has many tags. I need to search one of the values from a tag and compare it with a&amp;nbsp; table in mssql database . Based on the value in the table that gets matched with this tag value I need to move one node from the xml ahead for further processing.for a different value found in table I need to map another xml node
&lt;BR /&gt;Eg consider xml payload
&lt;BR /&gt;&amp;lt;amt&amp;gt;12&amp;lt;/amt&amp;gt;
&lt;BR /&gt;&amp;lt;foreignamt&amp;gt;78&amp;lt;/foreignamt&amp;gt;
&lt;BR /&gt;&amp;lt;currency&amp;gt;USD&amp;lt;/currency&amp;gt;
&lt;BR /&gt;I need to compare currency with a database table and if its USD select amt to be mapped to downstream system in txmlmap else select foreignamt if its any other currency. the rule is stored in database table and can be changed in future so etl needs to refer to table to decide..what sequence of talend components would be simplest to handle this.</description>
      <pubDate>Sat, 25 Apr 2015 09:54:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Mapping-output-columns-in-txmlmap-based-on-conditions-from-table/m-p/2234376#M23763</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-25T09:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping output columns in txmlmap based on conditions from table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Mapping-output-columns-in-txmlmap-based-on-conditions-from-table/m-p/2234377#M23764</link>
      <description>Hi&amp;nbsp;
&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;I need to compare currency with a database table and if its USD select amt to be mapped to downstream system in txmlmap else select foreignamt if its any other currency. t&lt;/FONT&gt;&lt;/FONT&gt;&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;I have tried to understand your request, but can't still. Can you please show us an example of your table data? and explain what are your expected result?
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
      <pubDate>Sun, 26 Apr 2015 11:54:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Mapping-output-columns-in-txmlmap-based-on-conditions-from-table/m-p/2234377#M23764</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-26T11:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping output columns in txmlmap based on conditions from table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Mapping-output-columns-in-txmlmap-based-on-conditions-from-table/m-p/2234378#M23765</link>
      <description>I am getting an XML payload which has many tags. I need to search one of the values from a tag and compare it with a &amp;nbsp;table in mssql database . Based on the value in the table that gets matched with this tag value I need to move one node from the xml ahead for further processing.for a different value found in table I need to map another xml node 
&lt;BR /&gt;Eg consider xml file i have input to txmlmap is&amp;nbsp; 
&lt;BR /&gt;... 
&lt;BR /&gt;&amp;lt;amt&amp;gt;12&amp;lt;/amt&amp;gt; 
&lt;BR /&gt;&amp;lt;foreignamt&amp;gt;78&amp;lt;/foreignamt&amp;gt; 
&lt;BR /&gt;&amp;lt;currency&amp;gt;USD&amp;lt;/currency&amp;gt; 
&lt;BR /&gt;... 
&lt;BR /&gt;Now i need to map this xml to a different output xml with structure like 
&lt;BR /&gt;.. 
&lt;BR /&gt;&amp;lt;currency&amp;gt;USD&amp;lt;/currency&amp;gt; 
&lt;BR /&gt;&amp;lt;outputamt&amp;gt;&amp;lt;/outputamt&amp;gt; 
&lt;BR /&gt;... 
&lt;BR /&gt;(I have extracted the relevant xml structure ..the actual xml is much bigger) 
&lt;BR /&gt;However before that i need to check the currency value from the input xml. 
&lt;BR /&gt;I need to extract the currency value and compare it against a database table with structure like below 
&lt;BR /&gt;create table currency_switch 
&lt;BR /&gt;(currency char(10), 
&lt;BR /&gt;&amp;nbsp;output_value char(1) ) 
&lt;BR /&gt;This table will have rows like 
&lt;BR /&gt;currency output_value 
&lt;BR /&gt;USD &amp;nbsp; &amp;nbsp; &amp;nbsp;A 
&lt;BR /&gt;EURO &amp;nbsp; &amp;nbsp; F 
&lt;BR /&gt;GBP &amp;nbsp; &amp;nbsp; &amp;nbsp;F 
&lt;BR /&gt;AUD &amp;nbsp; &amp;nbsp; &amp;nbsp;A 
&lt;BR /&gt;Thus if the currency value from input xml is &amp;nbsp;USD/AUD i need to map &amp;lt;amount&amp;gt;12&amp;lt;/amount&amp;gt; to the output column&amp;nbsp; 
&lt;BR /&gt;outputamt. If the currency value is EURO/GBP..then i need to map foreignamt which is 78 in this example to output column&amp;nbsp; 
&lt;BR /&gt;outputamt..</description>
      <pubDate>Wed, 29 Apr 2015 09:26:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Mapping-output-columns-in-txmlmap-based-on-conditions-from-table/m-p/2234378#M23765</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-29T09:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping output columns in txmlmap based on conditions from table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Mapping-output-columns-in-txmlmap-based-on-conditions-from-table/m-p/2234379#M23766</link>
      <description>Hi&amp;nbsp; 
&lt;BR /&gt;If I understand your request well, you need to do a join base on&amp;nbsp;currency&amp;nbsp;column on tXMLMap and generate the value of outputamt column based on the output value column from table. For example: 
&lt;BR /&gt;....main(row1)--&amp;gt;tXMLMap---main--tLogRow 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lookup(row2) 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tMysqlOutput 
&lt;BR /&gt;write the expression of outputamt column as: 
&lt;BR /&gt;row2.output_value.equals("A")?row1.amt:row1.foreignamt 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Wed, 29 Apr 2015 14:54:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Mapping-output-columns-in-txmlmap-based-on-conditions-from-table/m-p/2234379#M23766</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-29T14:54:02Z</dc:date>
    </item>
  </channel>
</rss>

