Order the rank based on group

Highlighted
Four Stars

Order the rank based on group

Following is the requirement.  With using old rank and need to create sequence, could you please say components need to use for the same? I have ordered the rank and used sequence, but not sure like taking the prodId as group

 

Input
ProdId Rank
101   2
101   3
101   4
102   3
102   4
102   5


Output
ProdId Rank
101   1
101   2
101   3
102   1
102   2
102   3

 


Accepted Solutions
Employee

Re: Order the rank based on group

Hi,

 

    You can use the below job snippet to do it. I got the result as per your requirement.

 

image.png

 

 

The tmap is as shown below. I have given the value of Prod_Id as the input for generating sequence number.

image.png

 

 

Please mark the topic as solution provided if the answer has helped to resolve your issue.

 

Warm Regards,

 

Nikhil Thampi


All Replies
Employee

Re: Order the rank based on group

Hi,

 

    You can use the below job snippet to do it. I got the result as per your requirement.

 

image.png

 

 

The tmap is as shown below. I have given the value of Prod_Id as the input for generating sequence number.

image.png

 

 

Please mark the topic as solution provided if the answer has helped to resolve your issue.

 

Warm Regards,

 

Nikhil Thampi

Four Stars

Re: Order the rank based on group

Thanks it helped
Employee

Re: Order the rank based on group

Hi,

       Happy to help you.

 

       Enjoy programming in Talend :-)

 

Warm Regards,

 

Nikhil Thampi

 

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch