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

 

1 ACCEPTED SOLUTION

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

3 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