Solved

Excel Writer - Multiple Row Number Attributes?

  • 27 March 2023
  • 2 replies
  • 17 views

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.

icon

Best answer by nampreetatsafe 30 March 2023, 21:51

View original

2 replies

Badge +10

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!

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