Ranking

One Star

Ranking

Hi,
Is it possible to gerneate ranks for both whole tables or intra-group ranks?
Thanks,
Jay
One Star

Re: Ranking

Hi,
Something like tRankRow and tGroupRankRow would be very useful in the package. As a small option the ability to generate ranks either largest = smallest rank or largest rank would be useful. For tGroupRankRow it should have the same abilities as tAggreage as far as many group variables.
This type of grouping ability would be useful for all kinds of transformation beyond ranks as well.
Is anything like this on the way or planned Talend?
Many Thanks,
Jay
Employee

Re: Ranking

I would like to understand your request and for this I would really like an example of what would be the input and the output of this component.
One Star

Re: Ranking

Hi plegall,
The only reason I posted it as a stand alone component is because of sort and aggreate.
Input and output? Data table in, New column with rank values appeneded to the output.
The intra-group ranking would be especially useful. I posted in the expression builder as well because the ability to use these as function in tMap would also be useful.
Please ask me anythign else you need. I would be happy to answer.
Thanks,
Jay
Employee

Re: Ranking

Input and output? Data table in, New column with rank values appeneded to the output.

How do you fill the new column?
One Star

Re: Ranking

The new column would contain the rank value.
INPUT:
COUNTRY CITY SALES
Canada Toronto 500000
Canada Vancouver 200000
France Paris 900000
OUTPUT:
COUNTRY CITY SALES RANK
Canada Toronto 500000 2
Canada Vancouver 200000 3
France Paris 900000 1
One Star

Re: Ranking

The method for ties is important and perhaps several options could be available such as all tied value gets the same rank or assigned them a sequence based on the order of rows. The ability to specify asc or desc for the rank integer is also helpful.
Unfrelated but is there any easy way to access row counts?
Thanks,
Jay
Employee

Re: Ranking

(I assume the rank value is based on the SALES column)
So you want to keep your data input order but you also want to know the rank of the column.
How do you manage duplicate values ? (2 SALES of the same value)
We can already do this with a join in the tMap, this is the way I would do it to avoid large memory usage. If you're interested I will explain the job.
One Star

Re: Ranking

Yes I would definately be interested in that. I posted about this in the expression builder post as well in hopes that it could be used within tMap.
Can I do intra-group ranking with possibly a few grouping fields and the choice of asc or desc?
One Star

Re: Ranking

Hi plegall,
In the simplest case the "intra-group" rank would just be a count which resets at a change in a specified field or group of fields for a sorted dataset.
For ties (duplicates) it would be useful to have options. The first case would be something like the beginning of this message where everything receives a unique rank, duplicates receiving the rank as per the order of the rows. The second most common case is usually where ties all receive the same rank thus creating a dataset where the number of unique ranks does not equal the number of records.
The ability to take into account the total number of records (also for groupings) and to rank in the reverse order would be a small thing that could be handy.
Would this be possible in the existing tMap component?
Many Thanks,
Jay
Employee

Re: Ranking

Yes I would definately be interested in that.

My input file contains:
Toronto;500000
Vancouver;200000
Paris;900000
Lyon;500000

My output is:
Starting job topic882 at 18:20 25/06/2007.
.---------------------------.
| tLogRow_1 |
+-----------+--------+------+
| city | sales | rank |
+-----------+--------+------+
| Toronto | 500000 | 2 |
| Vancouver | 200000 | 3 |
| Paris | 900000 | 1 |
| Lyon | 500000 | 2 |
'-----------+--------+------'
Job topic882 ended at 18:20 25/06/2007.
One Star

Re: Ranking

Hi plegall,
I'm having trouble viewing your images. They are super small and don't seem to download.
Thanks for your help.
I am interested in ranks in general but more so in "group" ranks. This is all for use in jobs such as: http://www.talendforge.org/forum/viewtopic.php?id=889 or ones where it is desired to have a variety of calculations run up front and stored for later use in reports and other queries.
Best Regards,
Jay
One Star

Re: Ranking

Hi all,please any body help me how to generate ranking positions for the column(ExSmiley FrustratedALARY) using talend.