Home > Software > Data-Warehouse > Informatica
Interview Questions   Tutorials   Discussions   Programs

Informatica - How to get EVEN & ODD numbers separately?

3972
views
asked marvit March 8, 2015 05:19 PM

How to get EVEN & ODD numbers separately?

This answer is pending moderator approval just create a sequence or choose any surrogate key and create router, make two groups even and odd and apply  the condition mod(seqval,2)=0  for even and  mod(seqval,2)=1 for odd in router transformation. connect according to the groups to the target.
flag

S->SQ->ROUTER->trgeven ->trgodd create a group in router and give condition mod(seqno ,2)=0 and default group hold remaining data (Odd Record consume )

flag

mod(seq,2)=0 mod(seq,2)=2

flag

In router Transformation give conditions like for even numbers mod(seqnum,2)=0 and for odd numbers mod(seqnum,2)=1.

flag

TAKE SEQUENCE GENERATOR TRANSFORMATION THEN EXPRESSION AND COPY ALL PORTS FROM SORCEQUALIFIER TO EXPTR AND SEQGNTR TO EXPRESSION THEN TAKE ROUTER AND COPY ALL PORTS FROM EXPRESSION TR AND CREATE TWO GROUPS EVEN AND ODD..IN EVEN WRITE A CONDITION (NEXTVAL,2)=0 AND IN ODD (NEXTVAL,2)!=0 AND CONNECT TWO TWO TARGETS.

flag

hi swetha its not working.can u explain once

flag

Use router t/r and write mod(seqno,2)=0 and pass to a tgt and another condition is mod(seqno,2)!=0

flag

If we use Aggregator without using group by option we will get only one row from source. It is a default character of Informatica.

e.g If there are 20 rows in the source table and only using SQ and followed by Aggregator then target table then the target table will be populated by the last row coming from  source table.
flag

Join with account you already have

Preview

Online-Classroom Classes
www.writeabc.com

2 people following this question

2 people following this tag

Question tags

informatica × 1

Asked 4 years and 5 months ago ago
Number of Views -3972