Skip to main content
Solved

Change output excel sheet (or file name) based on attribute name

  • November 27, 2018
  • 7 replies
  • 199 views

majkiboy
Contributor
Forum|alt.badge.img

I'm sorry if this has been answered before but I couldn't find the exact answer to my question which is:

How do I change the output name of an excel sheet (or file) based on a specific attribute name.

 

Example:

I need my output sheet name to be "Namn" and automatically read from the attribute name since I have multiple similar datasets but with variations on "Namn". All of which should be put into a separeate sheet but in the same file.

It is probably really simple but as I said, I couldn't find it.

(For me the output parameters and schemas are real confusing)

 

Best answer by debbiatsafe

majkiboy wrote:

I'm not sure it helps. The first sentence in the link you sent says: "A fanout is a way within FME to split output data based upon the value of an attribute. " I don't need the value of the attribute, I need the name. Or am I missing something obvious?

I need something simple like "@column_1_attribute_name" to put into the "sheet name" box. Is there something like this?

Hi @majkiboy

My apologies for misreading your question.

Attached is a workspace which uses the Schema reader to get the attribute names of the input Excel file, Tester to get the first attribute name, and a FeatureJoiner to join the attribute name onto the input Excel features.

I hope this helps.

GetAttributeName_QA.fmwt

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

7 replies

debbiatsafe
Safer
Forum|alt.badge.img+20
  • Safer
  • November 27, 2018

Hi @majkiboy

You would want to use a feature type fanout. You can set this in the Excel writer feature type dialog. This article also contains instructions on how to fanout in FME.

I hope this helps.


ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • November 27, 2018
debbiatsafe wrote:

Hi @majkiboy

You would want to use a feature type fanout. You can set this in the Excel writer feature type dialog. This article also contains instructions on how to fanout in FME.

I hope this helps.

I think they want the sheet name to be called Namn (or the other variations of this), rather than the value of Namn.


majkiboy
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • November 27, 2018
debbiatsafe wrote:

Hi @majkiboy

You would want to use a feature type fanout. You can set this in the Excel writer feature type dialog. This article also contains instructions on how to fanout in FME.

I hope this helps.

I'm not sure it helps. The first sentence in the link you sent says: "A fanout is a way within FME to split output data based upon the value of an attribute. " I don't need the value of the attribute, I need the name. Or am I missing something obvious?

I need something simple like "@column_1_attribute_name" to put into the "sheet name" box. Is there something like this?


ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • November 27, 2018

Is it always the first column?


majkiboy
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • November 27, 2018
ebygomm wrote:

Is it always the first column?

Yes, it is!


debbiatsafe
Safer
Forum|alt.badge.img+20
  • Safer
  • Best Answer
  • November 28, 2018
majkiboy wrote:

I'm not sure it helps. The first sentence in the link you sent says: "A fanout is a way within FME to split output data based upon the value of an attribute. " I don't need the value of the attribute, I need the name. Or am I missing something obvious?

I need something simple like "@column_1_attribute_name" to put into the "sheet name" box. Is there something like this?

Hi @majkiboy

My apologies for misreading your question.

Attached is a workspace which uses the Schema reader to get the attribute names of the input Excel file, Tester to get the first attribute name, and a FeatureJoiner to join the attribute name onto the input Excel features.

I hope this helps.

GetAttributeName_QA.fmwt


majkiboy
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • December 4, 2018
debbiatsafe wrote:

Hi @majkiboy

My apologies for misreading your question.

Attached is a workspace which uses the Schema reader to get the attribute names of the input Excel file, Tester to get the first attribute name, and a FeatureJoiner to join the attribute name onto the input Excel features.

I hope this helps.

GetAttributeName_QA.fmwt

Thank you very much! I still kind of don't understand this, but at least I can see it working. I have to study what you actually did in your workspace!


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