Maximum score details among 10 records using transformer stage

I have 5 records in student table. I want maximum score student details. How to do this with transformer stage.
Example:Input::: Student table
Sno smarks
1 50
2 45
3 34
4 50
5 33
I want output like this::
sno smarks
1 50
4 50

Showing Answers 1 - 6 of 6 Answers

srinivas

  • Apr 15th, 2016
 

We can implement this scenario in transformer stage, for that create three stage variables.

Step1: In transformer stage properties sort the smarks field as descending order.

Step2: Create three stage variables sv1,sv2,sv3
In Sv1: derivation map the smarks column
In Sv2: Sv1<=Sv3 then 1 else 0
In Sv3: derivation assign the Sv1 stage variable.

Above three stage variables give the 1 and zeros ,1 is maximum marks students and zero is rest.
So now In output tab constraint section give the following constraint
sv2=1
..After that compile and run the job you will get your desired out put.

Thanks,
Srinivas

  Was this answer useful?  Yes

dhanu

  • Apr 30th, 2016
 

Use a sorter transformation(sort -desc), add a sequence generator(nxt val=1).

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions