Skip to main content
Solved

Write files from attributes - Fanout does not do the trick


aron
Supporter
Forum|alt.badge.img+16
  • Supporter

I have a dataset where want to write separate files based on multiple attributes. From the example below I would like to write a file with all the Jones, another with all the Smith, a third with all the Farmer and a fourth with any Kim. Fanout does not handle multiple attributes and in this case the StringConcatenator trick wont help, since most of the rows would be contributing to separate files.

Any ideas on how I can achieve this?

 

A

 

B

 

C

 

D

 

Jones

 

 

Farmer

 

Kim

 

Jones

 

Smith

 

 

 

Jones

 

Smith

 

Farmer

 

 

Best answer by takashi

Hi @aron, if I understand your requirement correctly, this workflow does the trick.

 

View original
Did this help you find an answer to your question?

5 replies

takashi
Influencer
  • May 11, 2020

In the case, do you want to create these three files?

  1. Jones-Farmer-Kim
  2. Jones-Smith
  3. Jones-Smith-Farmer

aron
Supporter
Forum|alt.badge.img+16
  • Author
  • Supporter
  • May 11, 2020
takashi wrote:

In the case, do you want to create these three files?

  1. Jones-Farmer-Kim
  2. Jones-Smith
  3. Jones-Smith-Farmer

No, I want to create these four files: :)

1. Jones (With features from rows 1-3)

2. Smith (With features from rows 2-3)

3. Farmer (With features from rows 1 and 3)

4. Kim (With features from row 1)


takashi
Influencer
  • Best Answer
  • May 11, 2020

Hi @aron, if I understand your requirement correctly, this workflow does the trick.

 


bwn
Evangelist
Forum|alt.badge.img+26
  • Evangelist
  • May 11, 2020
takashi wrote:

Hi @aron, if I understand your requirement correctly, this workflow does the trick.

 

To add to @takashi 's great idea, may achieve faster execution by replacing the Tester with an AttributeFilter, set to Filter "_fanout_attribute" values. The <Unfiltered> Output Port will have the same values as the Tester above.

This is because AttributeFilter builds an Attribute index and also is Bulk Mode Enabled so generally works faster than the equivalent Tester.

  • In my test FME 2018 workspace with 1,000,000 Features with AttributeCopier->Tester. Takes 26 seconds.
  • With the same workspace with AttributeCopier->AttributeFilter. Takes 0.4 seconds!

aron
Supporter
Forum|alt.badge.img+16
  • Author
  • Supporter
  • May 11, 2020

Thanks! Worked like a dream! :)


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings