Search code examples
pentahokettle

pentaho data integration dynamic file name


New to PDI here. Need to output data from a view in a postgresql database to a file daily. The output file will be like xxxx_20160427.txt, so need to append the dynamic date in the file name. How to do it?

EDIT-----------------

I was not clear here by asking how to add dynamic date, I was trying to add not just date but optional other parts to the file name. E.g adding a serial no (01) at the end: xxxx_2016042701.txt etc. So my real question is how to make a dynamic file name? In other ETL tool e.g. SSIS it will be a simple expression. Not sure how it is done in PDI?


Solution

  • You can create a dynamic filename variable with a Modified Java Script value STEP.

    enter image description here

    and then in the Text File Output STEP click on "Accept file name from field", and select your variable declared from previous step (filename_var on this example).

    enter image description here