Skip to main content
Solved

Excel Writer - Multiple Row Number Attributes?


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

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!

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

2 replies

nampreetatsafe
Safer
Forum|alt.badge.img+12

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
  • March 31, 2023
nampreetatsafe wrote:

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!


Reply


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