how can i get 2nd highest salary in datastage?can u send me
,thanQ
2)if i had source has 2 records 1st record ie 1st column
contains 1,2,3 and 2nd coulmn contains 10,10,10 i have to
get target as 2nd columns as 20,30,40 how can i?

Answer Posted / ram

there are two ways you can get.
1. sort the data in descending order and make true the
create key change column.
2. this can be done in transformer stage at stage variables.
a. first sort the data on descending order (key would the
column which you wanted to be).
define three stage variables in transformer....sv1,sv2 & sv3
set sv2 and sv3 initial values to 0.
then...
if (salary=sv3) then sv2 else (sv2+1) ------> sv1
sv1 -------> sv2
salary --------> sv3

in next link filter...
constraint sv1=1
now you can see all 1st highest salary, 2nd highest
salary..and so on

Is This Answer Correct ?    5 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of datastage director?

824


How to find value from a column in a dataset?

1984


Hi everyone,I have kept a project Sales And Distribution for a pharmaceutical company.can anybody explain one complex business rule that we had in our project and how did you accomplish it using DS?

2030


How a routine is called in datastage job?

875


What is the difference between server job and parallel jobs?

944


what is stage is used for below Input columns: dept|mgr|employee|salary Output columns: mgr|count of employee per mgr|avg salary per dept note: each dept has one mgr and each mgr has many employees

880


Different ways a project can be moved to production ?...example ….export-import and Version control.

2223


I have a few records just I want to store data in to targets cycling way how?

2160


Enlist various types of routines in datastage.

929


project Steps,hits, Project level HArd things,Solved methods?

1873


What is the difference between account and directory options ?

925


Name the command line functions to import and export the DS jobs?

946


On which Dimension Table you implemented SCD Type in your Project

1814


whom do you report?

1739


how to delete one row in target dataset

2880