Pentaho

 View Only

 How to get Previous month date using Pentaho Data Integration

  • Pentaho
  • Kettle
  • Pentaho
  • Pentaho Data Integration PDI
rani p's profile image
rani p posted 06-12-2021 08:08

I am trying to add columns like Latest_Date(which is previous month date), Creation Date(which is present date), Year, Month. Could anyone give inputs how to add these in pentaho.


#Kettle
#Pentaho
#PentahoDataIntegrationPDI
Brandon Jackson's profile image
Brandon Jackson

If you are taking in a date as an input field, you can use the calculator step to perform date math on it. If you are trying to grab the date from another row, then you can use the Analysis Step to get 1 row ahead to pull that date forward.

 

I usually end up using a Javascript Step and copy paste a good date math library into it as a 'startup script' and then create another tab in the step as the transform script and perform the calculations.

 

moment.js is helpful.