Top values in desc order based on key column

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

priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

srinivas.g wrote:

Code: Select all

Sequential file --> copy--> copy--->transformer-->aggregator
                                     |                 |
                                                              
                                   Join        <---  filter
                                      |
                                   output
always try to use code tag it preserves the white spaces.

Code: Select all

sequential file-> sort (partition)->transformer-> output

in sort stage "Sort Column A Ascending and ColumnB Descending and Partition on Column A" in transformer use three stage variable
PrevKey
CurrKey
Count (initialize with 1)

in same order mentioned above

prev key to store prev value current for the incoming record

if PrevKey is equal to current one increase the value by 1 else re- initialize with 1, put a constraint on output link as count<4

Hope now you understand.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Post Reply