Customer Portal

CloverDX ETL process - Source filename to the output file name

Comments 2

  • Avatar
    Tomas Pavlas
    0
    Comment actions Permalink

    Hello,

    Certainly, achieving that is quite straightforward. Let me introduce you to the instructions:

    1. Set up the Metadata:
      Depending on your intended data usage, you can either create User Defined Metadata or Extract them. Then, open the metadata and add a new field called "fileName". In the field properties, locate "Autofilling" and set it to "source name".

     

    1. Add the time stamp:
      In this example, I will use the Map component to modify the filename. To achieve the desired filename format you mentioned, we'll utilize the today() function to obtain the timestamp. Then, using the date2str function, we'll extract only the date in the desired format and set the output field fileName as source fileName + "_" + the defined date. Here's an example code:

    string thisday;
    function integer transform() {

    $out.0.data = $in.0.data;
    thisday = date2str(today(),"yyyyMMdd");
    $out.0.fileName = getFileNameWithoutExtension($in.0.fileName) +"_"+ thisday;

          return ALL;
    }

     

    1. Set the SpreadsheetDataWriter:
      Use the “#“ placeholder for the name to define the .xlsx suffix and configure properties as follows:

    Now, the graph will store files named after the source file and the date on which the data processing was executed in the data-out directory.

    Best regards.

  • Avatar
    CloverDxNewBie
    0
    Comment actions Permalink

    Hi Tomas, thank you so much, I will try that today, many thanks, I will update you once i have managed to work out.

Please sign in to leave a comment.