How to get the Rank and AVG

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
deesh
Participant
Posts: 193
Joined: Mon Oct 08, 2007 2:57 am

How to get the Rank and AVG

Post by deesh »

Hi,
I have one doubt, I am generating the mark list for a school,
Here I need "AVG" per subject , and I need rank wise students.

Example:
In VI class have 50 students and 5 subjects, I need each subject "AVG" of 50 students, and need Highest score basis rank. I need to fill AVG in One target and Rank in Another Target.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

DataStage is not a reporting tool. You would ordinarily use regular SQL to get these answers.

An Aggregator stage can give you an average (mean).

Rank is more difficult, particularly when you have not specified how you wish tied ranks to be handled. An ETL approach would typically involve sorted data and comparison with previous row (plus, perhaps, counters to handle tied ranks). An ETL approach is not a Good Thing.

Rely on a reporting (or business intelligence) tool to produce these figures.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply