You are on page 1of 14

Answers for scenarios

1) sq filter ds

Here sq means sequence file

In filter we writing condition

filter

where classes= city like A%

and

where classes= city like B%

2) target1

Sq sort filter

Reject data

Target 2

Sort:-

In sort we can use

Create key change column=true

Filter :-

Where classes= key change=1

Where classes= key change=0


3)

Aggregater filter ds tg1

sq

Aggregater:- reject

Group=deptno

aggreation

aggregation type=count row

lount output column=count

operation

allow null = false

filter:-

where classes=count<>1

where classes=count=1

reaming reject data

4)

Sq copy lookup filter1

aggregater

filter2

Copy:-

First taking copy with that data using agg,lookup give the connection
Agg:-

Aggregation type=count row

Count output column=count

Fiter1

Where clause=count=1

Filter2

Where clause=<>1

Where clause=1

Looup

In constrain give as a continues, continues

In looup drag & drop same column

T1

5) sq transformer

T2

T3

In constrains we can write condition

MOD[@inrownum,3]=0 Here 0 means t1 link,1 means

MOD[@inrownum,3]=1 t2 link in target ,2 means t3

MOD[@inrownum,3]=2

T1

6) sq transformer

T2
In constrains we can write condition

MOD[@inrownum,2]=0 Here 0 means t1 link,1 means

MOD[@inrownum,2]<>1 t2 link in target .

7) sq transformer

Here some much different. We want to create variables in stage variables.

Here s1& s2 are the variable creation in stage variable.

Stage variable
If dslink8.deptno=s2 then s1+1 else 1 S1
Ds link8.deptno S2

Ds link
Ds link8.deptno deptno
Ds link8.sal Sal
S1 targercount

8) sq transformer

Stage variable
If dslink8.deptno=s2 then s1+ds link8.sal else ds link8.sal S1
Ds link8.deptno S2

Ds link
Ds link8.deptno deptno
Ds link8.sal Sal
S1 target

10) agg

sq target

agg:-

gourp key =deptno

agg type=calculation

column for calculation=sal

sum output column=sum_sal

11)

Sq copy funnel ds(t)

In copy to funnel we can take the 3 output links.

Copy :-

Option

Force=false

In output column
Output name

Dslink5 Ds link5) In this place of output columns change in to maths


column write as marks
Dslink6
Ds link5) In this place of output columns
Dslink7
change in to physics column write as marks

Ds link5) In this place of output columns change in to


chemistry column write as marks

Then drag and drop the output data in copy to funnel.

Funnel:-

Options

Tunnel type=continuous funnel

Output drag and drop to output column then we getting

Target as sno,marks tow columns only.

13) sqt/rtg

Stage variable
If dslink3.deptno=s2 then s1:ds link3.sal else dslink3.sal S1
Ds link3.deptno S2

: means concatenation option

Ds link
Ds link3.deptno deptno
Ds link3.sal Sal
S1 target
15) sqt/rtg

Stage variable
If dslink3.deptno=s2 then s1+1 else 1 S1
Ds link3.deptno S2

Ds link
Ds link3.deptno deptno
S1 count
Right(str(0,7):dslink3.sal,10) Padding sum_sal
Right(str(0,7):dslink3.deptno,10) padding

Here we have the Right(),str(),field(),trim(),left() functions are in

Functions

String operation in the area we have

16) sqt/r tg

Stage variable
If dslink3.deptno=s3 then s1+1 else 1 S1
If Ds link3.deptno=s3 then s2+dslink3.sal else dslink3.sal S2
Dslink3.deptno S3

Ds link
Ds link3.deptno deptno
Ds link3.sal sal
S1 count
trim(s2,0,R) sum_sal
Right(str(0,4):dslink3.deptno,4) padding

17)sqt/r tg

Stage variable
Right(str(0,2):Field(ds link3.date,-,2),2) S1
Right(0,2):trim(Right(ds link3.date,2):-:L),2) S2

Ds link
Ds link3.empno empno
Ds link3.ename ename
Ds link3.date Date
S1 Sv_month
s2 sv_date
Left(dslink3.date,4):-:s1:-:s2) Sv_hire date

19) sqt/rtg

Stage variable
Field(ds link3.email,@,1) S1
Field(ds link3.email,_,1) S2

Ds link
Ds link3.deptno deptno
Ds link3.ename ename
Ds link3.email email
S1 Sv_email
s2 sv_email2
21) sqt/rtg

Ds link
Ds link3.d1 D1
@inrownum Count
Ds link3.d2 D2
@inrownum Count
Ds link3.d3 D3
@inrownum Count

22) filter copy terget1

Reference link

Sq copy lookup

Terget3
aggreg copy

sqfiltercopy agglookuptg Terget2

Filter:-

Filter

Where clause=city like A%

agg:-

grouping key

group=empno

group=ename

group=deptno

group=city

aggregation

aggregation type=calculation

column for calculation=sal

maximum value output column=max_sal

lookup table

Empno
Ename
Deptno
City

Max_sal
= Empno
Ename
Deptno
City

In lookup condition must have

Constrain

=continue,=continue

26) sqsort --t/r --remove duplicates tg

First we want to sort the data like sort processing stage or (In transformer we have stage
properties at top menu 1st stage properties-input-partitioning- partition type-hash

Sort-perform sort )

Stage variable
If dslink3.deptno=s2 then s1:,:ds link3.ename else ds link3.ename S1
Ds link3.deptno S2

Ds link
Ds link3.deptno deptno
Ds link3.ename ename
S1 target

Next Remove duplicates processing stage

Remove duplicates
Key=deptno

Option

Duplicate to retain=last

27) sq--t/r --tg

Stage variable
If dslink3.deptno=s2 then s1 else ds link3.ename S1
Ds link3.deptno S2

Ds link
Ds link3.deptno deptno
Ds link3.ename ename
S1 target

29) sq--t/r tg

Stage variable
Right(str(s2,ds link3.num),ds link3.num) S1
ds link3.name S2

Ds link
Ds link3.name Name
Ds link3.num num
S1 target
35)

Here we want use processing stages sq,--sort ,---t/r ,--tg

Sort:-

Key=name

Key=seq

t/r:-

Stage variable
If dslink7.name=s3 then s1:ds link7.desc else ds link7.desc S1
Ds link7.name S3

Ds link
Ds link7.name Name
Ds link7.seq Seq
Ds link7.desc Desc
S1 target
37) sqt/rtg

Stage variable
Field(ds link3.phdetails,-,2)<>s3 S2
Field(ds link3.phdetails, ,2) S3
If s2=1 then Field(ds link3.phdetails, -,1)else Right(str(0,3),3) S4
If s2=1 then Field(ds link3.phdetails, -,2)else Field(ds link3.phdetails,-,1) S5

Ds link
Ds link3.phdetails Phdetails
S4 Phcode
S5 phnum

You might also like