Customer Portal

SpreadsheetDataWriter: Need to write to sheet name not in metadata

Comments 1

  • Avatar
    admin
    0
    Comment actions Permalink
    The point is that the SpreadSheetDataWriter has been primarily designed to be able to partition data into separate files with user-defined file names (like output_<fieldValue1>). However, there isn't an easy way how to do that inside one file for sheet names yet.

    In order to have a field-related name of each sheet you just need to make sure that there is the exact field in your data (storing exactly the same value as is the desired name of the sheet). Then you can simply setup property "Sheet" to "Partition data into sheets by data fields" and select the right field from the list of available fields.

    In your situation, let me suggest a little workaround. In order to name the sheets to be something like "Zone <fieldValue1>, you should add a Reformat component right before the SpreadsheetDataWriter. Setup the Reformat component to add an extra field to your data (please note that you have to also create appropriate metadata to it). You can define the field in the Transform attribute as follows:

    concat("Zone " , $in.0.Zone)


    Then you can split data into sheets using the Sheet attribute and the new field (as described above). Also, as I understand that you don't want to have this extra field in your excel file, I would also recommend you to use "Exclude fields" property in SpreadsheetData Writer and set the newly created field to this attribute.

    I am attaching an example graph so that you can review all setups that I've suggested.

    I will also log a ticket to our development queue to revise the Sheet functionality for the future releases of CloverETL.

    Best Regards,

    Eva

Please sign in to leave a comment.