Page 1 of 1

Funnel Clarification

Posted: Sat Jun 07, 2008 9:20 am
by poornima.chandramouli
Hi,

I've 4 inputs to a funnel stage.

Each input dataset has values like

DS1: DS2: DS3: DS4:
A1 A2 A3 A4
B1 B2 B3 B4
C1 C2 C3 C4
D1 D2 D3 D4

I want the output in the format

A1
B1
C1
D1
A2
B2
C2
D2
A3
B3
C3
D3
A4
B4
C4
D4

How to avial this functionality.

Thanks

Posted: Sat Jun 07, 2008 12:50 pm
by Minhajuddin
If you set the funnel type to "Sequence" it should give you the desired output.
It copies all the records from the first input link, and then all the records from the second input link and so on....

Posted: Sat Jun 07, 2008 11:08 pm
by poornima.chandramouli
Minhajuddin wrote:If you set the funnel type to "Sequence" it should give you the desired output.
It copies all the records from the first input link, and then all the records from the second input link and so on....

My Datasets has the values like

DS1:
A1
B1
C1
D1


DS2:
A2
B2
C2
D2


DS3:
A3
B3
C3
D3


DS4:
A4
B4
C4
D4



I want the output like

A1
A2
A3
A4
B1
B2
B3
B4
C1
C2
C3
C4
D1
D2
D3
D4


But sequential funnel doesn't give these kind of results.

Awaiting for ur reply

Posted: Sun Jun 08, 2008 7:21 am
by ArndW
Any chance of telling us what results you did get?

Posted: Sun Jun 08, 2008 3:39 pm
by dsean
Use the Sort Funnel type and specify the first column as a Key.

Sequential Funnel combines the data sequentially from the first file , then the second file and so on.


Sean

Posted: Sun Jun 08, 2008 6:39 pm
by abc123
A funnel will not do what you are trying to do. A funnel combines data streams with exactly same column names. Yours are not. Even if they were, a funnel would not do what you are trying to do.

Send all 4 datasets to a copy stage. On the Output tab, drag all columns from the 4 datasets into the sequence that you want.

Use Sorted Funnel

Posted: Sun Jun 08, 2008 11:17 pm
by swapnilverma
Use sort method in funnel.

or else use a sort after the funnel.

Both will give u the desired result.

Posted: Mon Jun 09, 2008 10:40 am
by Minhajuddin
If I am not wrong the OP at first wanted the data to be collected from each link and dump the output on the output link i.e. take the data from the first input link and dump it on the output link then do the same for the second, third and fourth links.

And then the "requirement" has changed, Now the OP wants to collect data from links in a "round-robin" fashion. Unfortunately there is no mode in the Funnel stage which allows you to do this.

If you really want this kind of collection, your solution depends on what you are trying to funnel (two sequential files, two datasets or two links from some kind of stages).

The dumbest solution would be:

Code: Select all


ip_link1=====>Transformer==========LINK_TO_FUNNEL1============>
		(Generate a key (say, col "X")
		and a constant '1' (say, col "Y"))		

ip_link2=====>Transformer==========LINK_TO_FUNNEL2============>
		(Generate a key (say, col "X")
		and a constant '2' (say, col "Y"))		
							======>Funnel====>Sort on the generated key (Column 'X')and the constant (column 'Y')
ip_link3=====>Transformer==========LINK_TO_FUNNEL3============>
		(Generate a key (say, col "X")
		and a constant '3'(say, col "Y"))		

ip_link4=====>Transformer==========LINK_TO_FUNNEL4============>
		(Generate a key (say, col "X")
		and a constant '4'(say, col "Y"))		

And instead of using Transformers you can use Column generators and the generated key should start from the same value in all the transformers.