souce file having the columns like
if first row will be repeat i want the result like this
name company count
krish IBM 1
pooja TCS 1
nandini WIPRO 1
krish IBM 2
pooja TCS 2
use transforemr stage and give three stage variable with intial value as 0,
then give (if company=ibm then count=count+1 else stgvar1)
like give three conditions for remaing two companies in two stage variables)
and in column derivation give if company=ibm then stgvar1 else
if company=wipro then stgvar2 else if company=tcs then stgvar3 else 0(company not in list)
1. In Sort Stage, take two key, name & company and then go
to options and create a keyChange column.
2. In transformer stage, create a stage variable of integer
type (say Var1) and write in it's derivation:
if keyChange=1 then 1 else Var1+1
3. Now create a new column in tgt (say count) and in
transformer, assign that Var1 to the derivation of count.
4. Goto o/p tab of transformer and there sort the data on
You'll get the desired output.
If you have more queries, you can mail me on
we can use aggregator stage.. nad group on the basis of name and company...
Is This Answer Correct ?
Other Data Stage Interview Questions
Hi I have scenario like this
s/r table T/r table
vijay,2000 1 , vijay, 2000
kumar,3000 2 ,kumar , 3000
ravi ,4000 3 ,ravi , 4000
How can i get target table like that without using
I have load a Dataset in UAT with 2 Node configuration, imported the job into PROD environment which is 4 node configuration and using this DataSet as SRC to other job. will the job run fine or give any errors? If job runs fine, on how many nodes? 2 nodes or 4 nodes?
i want send my all duplicate record one tar and all uniq
records one target how we will perfome explain
how we will bring