Skip to main content
Solved

Excel Writer - Multiple Row Number Attributes?

  • March 27, 2023
  • 2 replies
  • 117 views

kzkjc
Contributor
Forum|alt.badge.img+4
  • Contributor
  • 2 replies

Hello,

 

I am writing to an excel sheet with an existing template. Before the writer, I am using a counter (starting at 0) and attribute creator to then use "Use attribute names as column positions" and "Row number attribute".

imageMy attributes are B, C and D which are various strings and B_row_number (@Evaluate(16*@Value(_count)+10)) and CD_row_number (@Evaluate(16*@Value(_count)+16)). I would like the output sheet to look like the image below:

imageUnfortunately, I can't assign different "Row Number Attributes" to arrange it this way (B using B_row_number, and C,D usin CD_row_number). I get the feeling there is a simple workaround I'm not seeing.

 

Any help is appreciated! Thank you.

Best answer by nampreetatsafe

Hi @kzkjc​, I'm throwing some ideas out there for you to try:

  1. Try writing out to the same file/sheet twice. For instance, write out attributes B using B_row_number using a FeatureWriter (removing C and D from the user attributes in the FeatureWriter), and then follow it up with a Writer to the same file/sheet that only writes attributes C and D. Here's a mock-up of what it might look like: image
  2. Deaggregate each row into two rows in your workflow so that one row has values for B (C and D would be empty), and the other row for a given record has values for C and D. Create a new row number attribute for all records which takes the value of B_row_number if it has a value, or CD_row_number

 

Hope these help!

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.

2 replies

nampreetatsafe
Safer
Forum|alt.badge.img+13
  • Safer
  • 383 replies
  • Best Answer
  • March 30, 2023

Hi @kzkjc​, I'm throwing some ideas out there for you to try:

  1. Try writing out to the same file/sheet twice. For instance, write out attributes B using B_row_number using a FeatureWriter (removing C and D from the user attributes in the FeatureWriter), and then follow it up with a Writer to the same file/sheet that only writes attributes C and D. Here's a mock-up of what it might look like: image
  2. Deaggregate each row into two rows in your workflow so that one row has values for B (C and D would be empty), and the other row for a given record has values for C and D. Create a new row number attribute for all records which takes the value of B_row_number if it has a value, or CD_row_number

 

Hope these help!


kzkjc
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • 2 replies
  • March 31, 2023

Hi @kzkjc​, I'm throwing some ideas out there for you to try:

  1. Try writing out to the same file/sheet twice. For instance, write out attributes B using B_row_number using a FeatureWriter (removing C and D from the user attributes in the FeatureWriter), and then follow it up with a Writer to the same file/sheet that only writes attributes C and D. Here's a mock-up of what it might look like: image
  2. Deaggregate each row into two rows in your workflow so that one row has values for B (C and D would be empty), and the other row for a given record has values for C and D. Create a new row number attribute for all records which takes the value of B_row_number if it has a value, or CD_row_number

 

Hope these help!

The feature writer solution worked really well. Thank you!