Skip to main content
Solved

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

  • November 27, 2018
  • 7 replies
  • 264 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

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

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

debbiatsafe
Safer
Forum|alt.badge.img+21
  • 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+46
  • Influencer
  • 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.

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

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+46
  • Influencer
  • November 27, 2018

Is it always the first column?


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

Is it always the first column?

Yes, it is!


debbiatsafe
Safer
Forum|alt.badge.img+21
  • Safer
  • Best Answer
  • November 28, 2018

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

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!