Skip to main content

Hey Safers,

I was wondering if it was possible to position an attribute to an exact row/column position!

Using the image below as an example I want to designate an attribute 'LICENSE' to the cell indicated by the red arrow, let's say its at G-5

Is there a formula I could use?

The spreadsheet can't reference a raw data table as its a fan out of many pipelines in one workbook (a,b,c,d)

Thanks,

Patrick

Hi Patrick, to write a feature to a specific row and column, you can use a combination of xlsx_row_id format attribute, combined with having the actual value you want to write in a attribute named by the column position.

e.g. if you want to write the value ABCD-1234 to the indicated cell G-5, you can generate a feature through your workflow, this feature should have 2 attributes, G = ABCD-1234, xlsx_row_id = 5. On the Writer feature type parameter, you will want to make sure the "User Attribute Names As Column Positions" is set to Yes. With this setting, if you insert to an existing sheet, without truncating or dropping the sheet, you will have the value inserted to G5, as you wanted.

 

If you are using this in a fanout scenario, these features should also each have an attribute to be fanned out by, that way they will be written to the sheet name designated by the fanout attribute.

 

Hope that helps a bit.

Hi @pcheng, you can specify an absolute cell position to which a value should be written by Excel column name (A, B, C, ...) and the row number.

Add an attribute (e.g. called "_row_number") which stores the row number"5" to the feature, define a destination attribute named "G" in the Excel writer feature type, and configure the parameters of the Excel writer feature type like this.

  • Output Field Names: No
  • Use Attribute Names As Column Positions: Yes
  • Row Number Attribute: _row_number <row number attribute that you have added to the feature>

The workflow looks like this, for example.


Hi Patrick, to write a feature to a specific row and column, you can use a combination of xlsx_row_id format attribute, combined with having the actual value you want to write in a attribute named by the column position.

e.g. if you want to write the value ABCD-1234 to the indicated cell G-5, you can generate a feature through your workflow, this feature should have 2 attributes, G = ABCD-1234, xlsx_row_id = 5. On the Writer feature type parameter, you will want to make sure the "User Attribute Names As Column Positions" is set to Yes. With this setting, if you insert to an existing sheet, without truncating or dropping the sheet, you will have the value inserted to G5, as you wanted.

 

If you are using this in a fanout scenario, these features should also each have an attribute to be fanned out by, that way they will be written to the sheet name designated by the fanout attribute.

 

Hope that helps a bit.
Hi @XiaomengAtSafe, in my experiences, it seems that you have to specify row number attribute explicitly via the Row Number Attribute parameter in the writer feature type.
Hi @XiaomengAtSafe, in my experiences, it seems that you have to specify row number attribute explicitly via the Row Number Attribute parameter in the writer feature type.
Good call, Takashi! I missed that part. Thanks for correcting me!

 

 


Hi @pcheng, you can specify an absolute cell position to which a value should be written by Excel column name (A, B, C, ...) and the row number.

Add an attribute (e.g. called "_row_number") which stores the row number"5" to the feature, define a destination attribute named "G" in the Excel writer feature type, and configure the parameters of the Excel writer feature type like this.

  • Output Field Names: No
  • Use Attribute Names As Column Positions: Yes
  • Row Number Attribute: _row_number <row number attribute that you have added to the feature>

The workflow looks like this, for example.

Thank you so much! This was very clear and easy to follow as well!

 

 


Hi @pcheng, you can specify an absolute cell position to which a value should be written by Excel column name (A, B, C, ...) and the row number.

Add an attribute (e.g. called "_row_number") which stores the row number"5" to the feature, define a destination attribute named "G" in the Excel writer feature type, and configure the parameters of the Excel writer feature type like this.

  • Output Field Names: No
  • Use Attribute Names As Column Positions: Yes
  • Row Number Attribute: _row_number <row number attribute that you have added to the feature>

The workflow looks like this, for example.

Another question stemming from this one, what happens if I wanted to populate G-6 with another attribute? I see this solution as only going for one cell item at a time. Hopefully I am just missing something

 

 


Another question stemming from this one, what happens if I wanted to populate G-6 with another attribute? I see this solution as only going for one cell item at a time. Hopefully I am just missing something

 

 

You can write multiple rows into G column with the same writer feature type. Try sending another feature that has "G" = "some value" and "_row_number" = "6".

 


You can write multiple rows into G column with the same writer feature type. Try sending another feature that has "G" = "some value" and "_row_number" = "6".

 

Thanks so much! Just to note you need separate attributecreators feeding into the same writer to get multiple attributes written in otherwise it gets overwritten!

 

 

Thanks again so much!

 


Reply