I have a scenario like
Deptno=10---->First record and last record
Deptno=20---->First record and last record
Deptno=30---->First record and last record
I want those first and last records from each department in
a single target. How to do this in DataStage, any one can
assist me.
Thanks in advance.
Answer Posted / subhash
1.
Source--->Sort stage--->copy stage======>(SRC1,SRC2)
From copy stage we have to take two source stages
(SRC1,SRC2)
SRC-->Removeduplicate stage(in this we can get first
record from each dept--> Duplicates To Retain=First)
SRC2--->Remove duplicate stage(in this we can get last
record from each dept--> Duplicates To Retain=Last)
using funnel we can add these results.
2.
source->sortstage->removeduplications->dataset
in sortstage->create key changecolumn=true
this will set '1' for 1st records and '0' next duplicate
records.
after
removeduplicates stage(key columns=Deptno, CreateKeyChange
Columns)->duplicates retain:-last
we can get last(CreateKeyChange is zero and from all the
duplicates in that group, we are retaing last record) and
first(CreateKeyChange is 1) record group(Dept) wise.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Notification Activity
What are the functionalities of link partitioner?
Which warehouse using in your datawarehouse
AGGREGATOR default datatype
How a source file is populated?
Hi,can any one please mention list of dimension and fact tables for Sales and Distribution System for a Pharmacutical company.
Name the different types of Lookups in Datastage?
disign the complex job in u r project?(they are aksing only complex job design and then data flow...)
Lookup constraints
Define oconv () and iconv () functions in datastage?
Is it possible to query a hash file?
What is the difference between datastage and datastage tx?
How do you generate sequence number in datastage?
Explain the situation where you have applied SCD in your project?
tell me 5 situations when we r using oracle db stages like orecle connector, oracle enterprise