ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Data Warehouse >> Data Stage
 
 


 

 
 Teradata interview questions  Teradata Interview Questions (178)
 Business Objects interview questions  Business Objects Interview Questions (750)
 Cognos interview questions  Cognos Interview Questions (838)
 Informatica interview questions  Informatica Interview Questions (1617)
 Crystal Enterprise Suite interview questions  Crystal Enterprise Suite Interview Questions (29)
 Actuate interview questions  Actuate Interview Questions (35)
 Ab Initio interview questions  Ab Initio Interview Questions (168)
 Data Stage interview questions  Data Stage Interview Questions (562)
 SAS interview questions  SAS Interview Questions (549)
 Micro Strategy interview questions  Micro Strategy Interview Questions (35)
 ETL interview questions  ETL Interview Questions (193)
 Data Warehouse General interview questions  Data Warehouse General Interview Questions (214)
Question
souce file having the columns like 
name company
krish IBM
pooja TCS
nandini WIPRO
krish IBM
pooja TCS
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


 Question Submitted By :: Krishnaveni
I also faced this Question!!     Rank Answer Posted By  
 
  Re: souce file having the columns like name company krish IBM pooja TCS nandini WIPRO krish IBM pooja TCS 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
Answer
# 1
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)
 
Is This Answer Correct ?    7 Yes 5 No
Shasank, Pr3systems
 
  Re: souce file having the columns like name company krish IBM pooja TCS nandini WIPRO krish IBM pooja TCS 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
Answer
# 2
first sort the both name and compamy and then,
using stage variable in transformer:
curr= name:company
val=if curr <> prev then 1 else val+1
prev=curr

o.p = val
name,company,val
 
Is This Answer Correct ?    6 Yes 2 No
Disney
 
 
 
  Re: souce file having the columns like name company krish IBM pooja TCS nandini WIPRO krish IBM pooja TCS 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
Answer
# 3
Just modified the last post with minor changes

First sort the both name and compamy and then,
using stage variable in transformer:
sv1= name:company
sv3=if sv1=sv2 then sv3+1 else sv3(initial value of sv3=1)
sv2=sv1(initial value of sv2 =XXXXXXX)

OP

name company count=sv3
 
Is This Answer Correct ?    3 Yes 2 No
Pushparaj
 
  Re: souce file having the columns like name company krish IBM pooja TCS nandini WIPRO krish IBM pooja TCS 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
Answer
# 4
Use below stage variables

create 4 stage variables

STG1 =NAME:COMPANY

STG2=1

STG3= IF STG1:STG4 THEN STG3+1 ELSE STG2

STG4= STG1

create extra column for store this ranks.


After this stage use the sort stage to sort the data based on ranking column.

Then will get the exact output what we are looking.

krish IBM 1
pooja TCS 1
nandini WIPRO 1
krish IBM 2
pooja TCS 2
 
Is This Answer Correct ?    1 Yes 0 No
Srinivas
 
  Re: souce file having the columns like name company krish IBM pooja TCS nandini WIPRO krish IBM pooja TCS 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
Answer
# 5
we can use aggregator stage.. nad group on the basis of name and company... 
Is This Answer Correct ?    0 Yes 0 No
Abc
 
  Re: souce file having the columns like name company krish IBM pooja TCS nandini WIPRO krish IBM pooja TCS 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
Answer
# 6
use aggregator stage take count(*) group by name 
Is This Answer Correct ?    1 Yes 0 No
Sankar
 
  Re: souce file having the columns like name company krish IBM pooja TCS nandini WIPRO krish IBM pooja TCS 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
Answer
# 7
Hi ALL,

Job Design:

SourceSeqFile--->SortStage--->Transformer--->TgtSeqFile

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
count column.
You'll get the desired output.

If you have more queries, you can mail me on
ankitgosain@gmail.com

Cheers,
Ankit :)
 
Is This Answer Correct ?    1 Yes 0 No
Ankit Gosain
 

 
 
 
Other Data Stage Interview Questions
 
  Question Asked @ Answers
 
HOW WILL YOU IMPLEMENT SURROGATE KEY IN SCD BY USING SURR_KEY GENERATOR,THE VALUE OF S_KEY SHOULD NOT REPEAT EVEN IF THE JOB IS COMPILED REPEATEDELY? L&T 4
A flatfile contains 200 records.I want to load first 50 records at first time running the job,second 50 records at second time running and so on,how u can develop the job?pls give the steps?pls pls TCS 5
Hi guys, 7. how to get this output i/p col1,col2 101,a 102,b 103,c 104,d o/p col1,col2 101,d 102,c 103,b 104,a Thanks IBM 1
What's the Main Function of the Staging area in DWH Oracle 3
Explain the functionality of your current project? IBM 1
A table containg 100 records B table containg 20 records we have to join two tables in left outer it containg target 100 records but target containg 101 record at that time what is the issue arise Polaris 1
What is exact difference between Parallel Jobs and server Jobs.. IBM 7
I have a source like file it have Number of records and i want to load without first and last records in target?Datastage? CSC 2
if a column contains data like abc,aaa,xyz,pwe,xok,abc,xyz,abc,pwe,abc,pwe,xok,xyz,xxx,abc, roy,pwe,aaa,xxx,xyz,roy,xok.... how to send the unique data to one source and remaining data to another source????   3
I WANT TO SEND SYSDATE AS PARAMETER,SO WHAT COMMAND I SHOULD USE TO CALL SYSDATE? ME 4
A flatfile contains 200 records.I want to load first 50 records at first time running the job,second 50 records at second time running and so on,how u can develop the job?pls give the steps? TCS 3
j1,j2,j3 jobs r runing iwant to run j1,j3 after j2 how to do this using sequencer? 2)j1,j2,j3 jobs r runing iwant to run j1,j2,j3 how to do this? Wipro 1
 
For more Data Stage Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com