<?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 increment id value only for distinct value in another column in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/increment-id-value-only-for-distinct-value-in-another-column/m-p/2221761#M15629</link>
    <description>&lt;P&gt;I am trying to increment the value of an id column which is based on value from another column after joining it to the input file. I am trying to implement this operation in tmap. So the structure is something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Main_file&lt;/P&gt;&lt;P&gt;column 1&lt;/P&gt;&lt;P&gt;column 2&lt;/P&gt;&lt;P&gt;column 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Look up 1&lt;/P&gt;&lt;P&gt;id&lt;/P&gt;&lt;P&gt;column 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am doing a left outer join on column 2 from input file and column 2 from look up table and trying to increment the value only for unique values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the following routine to populate the output column:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Var: Numeric.sequence("s2",(lkp1.id&amp;nbsp;&lt;SPAN&gt;== null)?1:lkp1.id+1,1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In output col: Relational.ISNULL(lkp1.col2) || lkp1.col2.equals("") ? Var.var1 : lkp1.id&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am getting a different id&amp;nbsp; for duplicate values in column 2&amp;nbsp; by doing this. However, what i need is unique id for unique column 2 value and same id for duplicate values. Any help on this will be much appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 02:36:40 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T02:36:40Z</dc:date>
    <item>
      <title>increment id value only for distinct value in another column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/increment-id-value-only-for-distinct-value-in-another-column/m-p/2221761#M15629</link>
      <description>&lt;P&gt;I am trying to increment the value of an id column which is based on value from another column after joining it to the input file. I am trying to implement this operation in tmap. So the structure is something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Main_file&lt;/P&gt;&lt;P&gt;column 1&lt;/P&gt;&lt;P&gt;column 2&lt;/P&gt;&lt;P&gt;column 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Look up 1&lt;/P&gt;&lt;P&gt;id&lt;/P&gt;&lt;P&gt;column 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am doing a left outer join on column 2 from input file and column 2 from look up table and trying to increment the value only for unique values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the following routine to populate the output column:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Var: Numeric.sequence("s2",(lkp1.id&amp;nbsp;&lt;SPAN&gt;== null)?1:lkp1.id+1,1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In output col: Relational.ISNULL(lkp1.col2) || lkp1.col2.equals("") ? Var.var1 : lkp1.id&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am getting a different id&amp;nbsp; for duplicate values in column 2&amp;nbsp; by doing this. However, what i need is unique id for unique column 2 value and same id for duplicate values. Any help on this will be much appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 02:36:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/increment-id-value-only-for-distinct-value-in-another-column/m-p/2221761#M15629</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T02:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: increment id value only for distinct value in another column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/increment-id-value-only-for-distinct-value-in-another-column/m-p/2221762#M15630</link>
      <description>Hi 
&lt;BR /&gt;I don't understand what are your expected output. Can you show us an example of your input data and expected output data? It will be helpful for us to understand your requirement. 
&lt;BR /&gt;
&lt;BR /&gt;Regards
&lt;BR /&gt;Shong</description>
      <pubDate>Fri, 24 Apr 2020 10:09:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/increment-id-value-only-for-distinct-value-in-another-column/m-p/2221762#M15630</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-24T10:09:08Z</dc:date>
    </item>
  </channel>
</rss>

