To populate top five values

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
nani0907
Participant
Posts: 155
Joined: Wed Apr 18, 2007 10:30 am

To populate top five values

Post by nani0907 »

Hi all

I have need to populate top five decimal values after doing validations for which i have used transformer stage.

Pleae share how do handle this .

Thanks in advance
thanks n regards
nani
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Re: To populate top five values

Post by ArndW »

nani0907 wrote:...populate top five decimal values...
Could you explain what you mean by that? Is it the rows with the 5 largest values in one column, or 5 decimal columns and getting the highest among them or some other action?
nani0907
Participant
Posts: 155
Joined: Wed Apr 18, 2007 10:30 am

Post by nani0907 »

It is to populate five largest decimal values.
thanks n regards
nani
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I am afraid that I still don't quite understand, would it be possible to give a short simplified example of what you wish to do?
nani0907
Participant
Posts: 155
Joined: Wed Apr 18, 2007 10:30 am

Post by nani0907 »

I getting the data as below

column A Column B
1 20.9
2 10.8
3 27.4
4 15.3
5 32.1
6 15.7

Output to be generted only for top five column B values in descending order
Coumn a Column B
5 32.1
3 27.4
1 20.9
6 15.7
4 15.3
Please help me out .
thanks n regards
nani
hamzaqk
Participant
Posts: 249
Joined: Tue Apr 17, 2007 5:50 am
Location: islamabad

Post by hamzaqk »

rank the columns and then based on column ranking filter only the first five records.

p.s i am sure your next question would be how to rank. for that search the forum :D
Teradata Certified Master V2R5
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Sort the data by descending value, then limit the output to the first 5 rows.
nani0907
Participant
Posts: 155
Joined: Wed Apr 18, 2007 10:30 am

Post by nani0907 »

How to limit the output to the first 5 rows
thanks n regards
nani
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

single-thread a transform stage (sequential as opposed to parallel, or a 1-node configuration) and then put a constraint "@INROWNUM < 6" in.
nani0907
Participant
Posts: 155
Joined: Wed Apr 18, 2007 10:30 am

Post by nani0907 »

Thanks a lot

Iam able to get required output
thanks n regards
nani
nani0907
Participant
Posts: 155
Joined: Wed Apr 18, 2007 10:30 am

Post by nani0907 »

Thanks a lot

Iam able to get required output
thanks n regards
nani
Post Reply