Order the rank based on group

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

 

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’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

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download