Skip to main content
Solved

Concatenating fields - cross tabulation

  • February 17, 2015
  • 7 replies
  • 14 views

Forum|alt.badge.img

Hi all,

 

I have a table in Excel that looks like (I have added he Case rows to make it clearer):

 

 

 

I have been asked to concatenate fields when for the same site there are two different countries or two different regions or both, as follows:

 

 

 

 

Does anyone have an idea of how I could achieve that in FME so that I can get the concatenation done for the three cases?

Best answer by takashi

Hi Darius,

 

 

Assuming that the concatenation should be performed for each Site group (1A, 2Z, and 3W in the example), I would use two Aggregators in a series.

 

 

1st Aggregator

 

Group By: SiteCode, County

 

Mode: Attributes Only

 

Keep Input Attributes: Yes

 

Attributes to Concatenate: Region

 

Separatoe Character: & (surround by whitespaces)

 

 

2nd Aggregator

 

Group By: SiteCode, Region

 

Mode: Attributes Only

 

Keep Input Attributes: Yes

 

Attributes to Concatenate: County

 

Separator Character: & (surround by whitespaces)

 

 

If you will respect the order of input features, expose "xlsx_row_id" in the Excel reader feature type, and insert the Sorter between the two Aggregators to sort by "xlsx_row_id".

 

 

Takashi
View original
Did this help you find an answer to your question?
<strong>This post is closed to further activity.</strong><br /> It may be a question with a best answer, an implemented idea, or just a post needing no comment.<br /> If you have a follow-up or related question, please <a href="https://community.safe.com/topic/new">post a new question or idea</a>.<br /> If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

takashi
Evangelist
  • Best Answer
  • February 17, 2015
Hi Darius,

 

 

Assuming that the concatenation should be performed for each Site group (1A, 2Z, and 3W in the example), I would use two Aggregators in a series.

 

 

1st Aggregator

 

Group By: SiteCode, County

 

Mode: Attributes Only

 

Keep Input Attributes: Yes

 

Attributes to Concatenate: Region

 

Separatoe Character: & (surround by whitespaces)

 

 

2nd Aggregator

 

Group By: SiteCode, Region

 

Mode: Attributes Only

 

Keep Input Attributes: Yes

 

Attributes to Concatenate: County

 

Separator Character: & (surround by whitespaces)

 

 

If you will respect the order of input features, expose "xlsx_row_id" in the Excel reader feature type, and insert the Sorter between the two Aggregators to sort by "xlsx_row_id".

 

 

Takashi

Forum|alt.badge.img
  • Author
  • February 17, 2015
Takashi, your approach worked nicely and efficiently. I didn't think the solution was so straightforward.

 

Thanks for your priceless help!

 

Darius

takashi
Evangelist
  • February 18, 2015
Good to hear that you accomplished the purpose.

 

In addition, try setting "Yes" to "Input is Ordered by Group" parameter of the Aggregators, if rows which contain attributes that should be concatenated are always consecutive. In this case, the Sorter would not be essential to keep the input order.

majdoleen
  • June 28, 2015
Hi All,

 

Thank you I found this very useful, I have started the workbench as seen in the attached, and it is working fine, but the problem that I got simillar value in the row (attached), any Idea how to remove the identical value in the row,

 

 

 

 

which tool is missing here?

 

 

Best,

 

Majdoleen

 

 

takashi
Evangelist
  • June 28, 2015
Hi Majdoleen,

 

 

How about using the DuplicateRemover?

 

 

Takashi

majdoleen
  • June 28, 2015
Thank you Takashi, but please could you explain more in details where I have to use it and what it must contains? I am new in FME.

 

 

Best,

 

Majdoleen

majdoleen
  • June 28, 2015
yes it is working perfect.

 

Thank you Takashi, really appreciate.

 

 

Best,

 

Majdoleen

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